S
SumGie
I need a command, (or function, or whatever) that will look at the keyboard
to determine if any keys are being pressed, without pausing if there are
none. The CIN>> command pauses the program to wait for a keypress.
I want a loop that will keep looping, updating the screen endlessly, until I
press a (particular) key to stop it. I'm trying to program a text example
of the game of life. I want to be able to tell it to go, and have it
running generations until I tell it to stop, and then return to a menu mode
where the user can turn individual cells on or off.
My C++ instructor has not been able to tell me a way to do this. Can any of
you? (adding machine language code to my program has been suggested, but is
not an option. We don't cover how to do that until much later in the
course, not to mention that I don't know machine language programming.)
Thanks all!
to determine if any keys are being pressed, without pausing if there are
none. The CIN>> command pauses the program to wait for a keypress.
I want a loop that will keep looping, updating the screen endlessly, until I
press a (particular) key to stop it. I'm trying to program a text example
of the game of life. I want to be able to tell it to go, and have it
running generations until I tell it to stop, and then return to a menu mode
where the user can turn individual cells on or off.
My C++ instructor has not been able to tell me a way to do this. Can any of
you? (adding machine language code to my program has been suggested, but is
not an option. We don't cover how to do that until much later in the
course, not to mention that I don't know machine language programming.)
Thanks all!