Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Add a Enter button
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Lucky1




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
TerranceN




PostPosted: 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().
Lucky1




PostPosted: 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?
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: