Computer Science Canada

Add a Enter button

Author:  Lucky1 [ Wed Jan 05, 2011 5:54 pm ]
Post subject:  Add a Enter button

What is it you are trying to achieve?
The user press any key to begin the game


What is the problem you are having?
What is the code for a game to begin if you want user to press any key

Describe what you have tried to solve this problem
exit when hasch
end loop
loop

but the code doesnt work for my game.

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
K so I have the instructions to the game but want to add a button where user presses any keys to begin the game.

Turing:

put "How to play:"
put "This game will generate 2 random numbers and you will guess the sum of the two numbers by looking at the LED. Each time you get it right you will gain one point and the game will end once you reach 3. Your game will begin as soon as you click Run! Watch the LED lights carefully!"
put " "
put "Press Enter to being"



Please specify what version of Turing you are using
4.1.1

Author:  TerranceN [ Wed Jan 05, 2011 6:01 pm ]
Post subject:  RE:Add a Enter button

Look at the code you have tried before, specifically at the order you have them in. By rearranging them logically, it should work to do what you are asking for.

Another way to pause until a user presses any key is Input.Pause().

Author:  Lucky1 [ Wed Jan 05, 2011 6:28 pm ]
Post subject:  Re: RE:Add a Enter button

TerranceN @ Wed Jan 05, 2011 6:01 pm wrote:
Look at the code you have tried before, specifically at the order you have them in. By rearranging them logically, it should work to do what you are asking for.

Another way to pause until a user presses any key is Input.Pause().



Just input pause after "Press any key to begin" ?
Input.Pause()

And what is he bracket for?

Author:  Tony [ Wed Jan 05, 2011 6:47 pm ]
Post subject:  Re: RE:Add a Enter button

Lucky1 @ Wed Jan 05, 2011 6:28 pm wrote:

Just input pause after "Press any key to begin" ?
Input.Pause()

Give it a try.
Lucky1 @ Wed Jan 05, 2011 6:28 pm wrote:

And what is (t)he bracket for?

To specify that this is a function call.


: