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

Username:   Password: 
 RegisterRegister   
 exit with anykey
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
lordfoamy




PostPosted: Thu Feb 14, 2008 11:03 pm   Post subject: exit with anykey

I had just learned this earlier today but I forgot the code, can anyone help me?

I need to be able to exit from a loop when anykey is pressed

I'm working on a little program to make finding the colours easier for me. Any help would be appreciated
Sponsor
Sponsor
Sponsor
sponsor
HeavenAgain




PostPosted: Thu Feb 14, 2008 11:37 pm   Post subject: RE:exit with anykey

Quote:
Turing:
% The "hasch" program
put "Press any key to stop the dice rolling"
var die1, die2 : int
loop
    randint (die1, 1, 6)
    randint (die2, 1, 6)
    locate (1, 1)
    put "You rolled ", die1 + die2
    exit when hasch
end loop

from the turing help manual
lordfoamy




PostPosted: Fri Feb 15, 2008 12:06 am   Post subject: Re: exit with anykey

thanks, thats helps a lot. I'll be uploading the program when it's done. or just keeping it if i find one on here.
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  [ 3 Posts ]
Jump to:   


Style:  
Search: