SgtMe 46 Veteran Poster Featured Poster

What do you mean when you take out drawing the rectangles? Of course if you don't draw them a trail will be left.

SgtMe 46 Veteran Poster Featured Poster
SgtMe 46 Veteran Poster Featured Poster

It is actually pointing to line 49. This is the default new-line at the end of your code. Look at the braces in your main. You have the opener for main, open and close for the while loop, BUT, you don't have the close brace for main.
Add another brace on line 49, without indentation.

SgtMe 46 Veteran Poster Featured Poster

Jeeeeeeeeeeeeeeeeeez! Nice work, I have to say...
665

SgtMe 46 Veteran Poster Featured Poster

Slipknot: "Duality"

SgtMe 46 Veteran Poster Featured Poster

archery -> bow

SgtMe 46 Veteran Poster Featured Poster

677

SgtMe 46 Veteran Poster Featured Poster

We won't do your homework for you.
If you get started and write some code, we can point you in the right direction.

SgtMe 46 Veteran Poster Featured Poster

No, it's not just the sprite. The dirty rectangle should be around the sprite, AND around the area the sprite was last in. If you only update the character, the rest of the screen won't be updated, hence you will get this trail.

SgtMe 46 Veteran Poster Featured Poster

drum -> cymbal

SgtMe 46 Veteran Poster Featured Poster

Don't worry apines, your back up has arrived...
673

SgtMe 46 Veteran Poster Featured Poster

673...

SgtMe 46 Veteran Poster Featured Poster

You could use a seperate IDE. Dev-C++ (though no longer in development) makes it easy to install libraries. You literally choose what you want from a list and it will download and install it.

SgtMe 46 Veteran Poster Featured Poster

metal -> music

SgtMe 46 Veteran Poster Featured Poster

673

SgtMe 46 Veteran Poster Featured Poster

667. Unfortunately I must leave soon as well. Night :)

SgtMe 46 Veteran Poster Featured Poster

Yes, yes it would. Unless it was one of the Murderdolls' sock puppets...that would be very cool.
Apines posted 667, so your post should have made 665, not 663, so I go back to...
667! ;)

SgtMe 46 Veteran Poster Featured Poster

C++
Allegro (easy): Keep using it until you are confident to move on.
OpenGL (intermediate): Can be used for 2D. Don't get frustrated and stick with it.
Direct2D (hard): Specially built 2D library, but DirectX is hard to code.

Python
PyGame (easy): Same as allegro really.
PyOpenGL (intermediate): Use it for 2D first, then 3D. Needs to be used through PyGame.

As for sharing it on the internet, why don't you upload it to sourceforge when you are done? Then people can join you if you want an extra pair of hands, report bugs easily and it's just generally great for project hosting.

SgtMe 46 Veteran Poster Featured Poster

665
Sorry Jon. It's 2 to 1 on this. We win ;)

SgtMe 46 Veteran Poster Featured Poster

Sweet sprites! It looks fine on my computer. I'm guessing it would be to do with the time it takes to redraw the scene? Have a look into dirty-rectangles and dirty-sprites. These only update the parts of the screen or the sprites that need updating, without redrawing the whole scene.

Dirty Rectangles:
http://www.pygame.org/docs/ref/display.html#pygame.display.flip (PyGame Doc)
http://muagames.com/tutorials/pygame-3-pong/pygame-3-pong-step-1/ (An example I found, do page search for "dirty" or "dirty rectangles")
http://www.pygame.org/docs/tut/newbieguide.html (Another example)

Dirty Sprites:
http://www.pygame.org/docs/ref/sprite.html#pygame.sprite.DirtySprite (PyGame Doc)
Couldn't find so much for this one. Have a look round yourself if your interested.

I'd say dirty rectangles would be the best way to go for now.

SgtMe 46 Veteran Poster Featured Poster

Well done guys! Confusion is the aim of the game on that one. Yes the answer is in the logic.
And sorry about the error :[

SgtMe 46 Veteran Poster Featured Poster

663

SgtMe 46 Veteran Poster Featured Poster

"My Last Serenade" - Killswitch Engage

SgtMe 46 Veteran Poster Featured Poster

I'd say allegro is fairly old. Doesn't mean it's not any good. I started out with it and it certainly helped me. I use PyGame and OpenGL with Python nowadays.
Did I solve your problem?

SgtMe 46 Veteran Poster Featured Poster

Three men book a hotel room that costs £30. They pay, then go to the room. Then, the manager realises that they should have only been charged £25. He gives the porter £5, with instructions to give it back to the three men. Realising that £5 won't split between 3 people, the porter decides to give them £3 back (£1 each) and pocket £2 for himself.

The men each paid £27 pounds for the room (£30 minus £3 split between them from the refund) and the porter has £2. 27+2 = 29. Where has the missing £1 gone?

PS.
Easy-ish to work out, hard to explain the answer. DON'T google it...on your honour -_-

SgtMe 46 Veteran Poster Featured Poster

Well a simple fix would be to multiply everything by 10. Ie:

import os
print float(1+1+1-3)/10
os.system("pause")
SgtMe 46 Veteran Poster Featured Poster

Are you getting compiler errors? Runtime errors? Is it that your program logic isn't working properly (ie your not getting the expected output)?
Please be more specific and we can help you. Thanks :)

SgtMe 46 Veteran Poster Featured Poster

^ doesn't know what I'm thinking either...
< jeez i need to get on with this work...
V has probably not done all their work either...

SgtMe 46 Veteran Poster Featured Poster

white -> paint

SgtMe 46 Veteran Poster Featured Poster

663

SgtMe 46 Veteran Poster Featured Poster

Please mark solved. Thanks.

SgtMe 46 Veteran Poster Featured Poster

Wow I haven't done allegro in a long time...
I think the problem may be that you need to clear the screen before you re-draw the text.

SgtMe 46 Veteran Poster Featured Poster

"The Bleeding" Five Finger Death Punch

Ezzaral commented: Good song. +0
SgtMe 46 Veteran Poster Featured Poster

cows -> milk

SgtMe 46 Veteran Poster Featured Poster

You could remove the system commands from my code. They are not essential. System means that it uses shell commands. I'm guessing your not on windows? Sorry I should have asked really :(

SgtMe 46 Veteran Poster Featured Poster

665. Sorry I was away for a day :)

SgtMe 46 Veteran Poster Featured Poster

Mass Effect (First One)

SgtMe 46 Veteran Poster Featured Poster

horn -> corn

SgtMe 46 Veteran Poster Featured Poster

OK here goes:
Start by making the base of your toolbar, without any dropdown bits in it. You will need a loop. At the top of the loop, you ask for the user to input a string. This string will be the label for a new button on the menu. Then, create a the item on the menu in the same base toolbar you made earlier, with the label being the string the user put in. You just need to pass variables to the statements that create the menu item.

SgtMe 46 Veteran Poster Featured Poster

Why didn't my code run? It runs fine for me. I'm confused.

SgtMe 46 Veteran Poster Featured Poster

665
[CoolSaying] [/CoolSaying]

SgtMe 46 Veteran Poster Featured Poster

Move to geek's lounge?

SgtMe 46 Veteran Poster Featured Poster

665. Yeah I spent a while helping out a guy in the C++ forum. He had quite a few things that needed fixing in his code and I've helped him along a fair way. I've been helping other people as well. I've also been practising guitar, 3D modeling and talking to people on MSN.
What about you? ;)

SgtMe 46 Veteran Poster Featured Poster

So your looking at GUI's? Tkinter would be your best bet. Look up how to create cascading menu's. I have a couple of youtube videos on them as well.
Just apply your own logic for how to create them from user input. It should be fairly simple.

Text documentation/tutorial:
http://www.pythonware.com/library/tkinter/introduction/x5819-patterns.htm
My videos:
http://www.youtube.com/watch?v=AxFOIaFYJq4
(You would probably only need the first one)
http://www.youtube.com/watch?v=EP1uxP2RPwc


Please upvote if this helped :)

SgtMe 46 Veteran Poster Featured Poster

venezuela -> vuvezela
(just 'cos it rhymes ;) )

SgtMe 46 Veteran Poster Featured Poster

665

SgtMe 46 Veteran Poster Featured Poster

I believe that the problem lies in line 7. You appear to create a variable called "array" (type double). In line 29, you are trying to call values from an array called "array". However, in line 7, you did not set "array" as an array. There is also something a little funny with the code order. You ask for the size of the array (user input) after you have declared it (or not at the moment). Furthermore, you declare variables "i" and "t" before use in the foor loops. A quicker way of doing this is:

for (int t=0; t<size; t++)   //note the int in the brackets before t
                                    //this initializes t

Nothing will be printed, as you have a return statement at line 30, before your "cout" statement loop at lines 33-35. This will end the function. You should return after your print statements, instead of returning "0". The user will not be able to see the "couts", as the console will close before you get a chance to look.

There may be another couple of things I have skipped informing you about in the above, but here is a working code I have.

#include <iostream>

using namespace std;

 int main()
{

    int size, value ;

    cout << "How many values do you wish to enter?\n";
    cin >> size;

    while (size>50)
    {
        cout << "Sorry, that was above 50" << endl;
        cout << "How many values do you wish to enter?\n";
        cin >> size;
    }
    
    double …
hiddepolen commented: Nice post, very lnog and informative. If the owner of the topic wont do it, I will... +1
SgtMe 46 Veteran Poster Featured Poster

665

SgtMe 46 Veteran Poster Featured Poster

facism -> socialism

SgtMe 46 Veteran Poster Featured Poster

bingo -> numbers
lol OK :)