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

Username:   Password: 
 RegisterRegister   
 Restarting the program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Big_Tom




PostPosted: Thu Mar 27, 2003 12:20 pm   Post subject: Restarting the program

How do i make it s that my program will restart after i see what i want to see. For example If i do 2+2 and i get 4 how can i make it so the user choses it to go back to the beginning of the program?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Mar 27, 2003 12:22 pm   Post subject: (No subject)

you use loops - http://www.compsci.ca/bbs/viewtopic.php?t=370

the tutorial describes all you need to know about loops + how to use them to move around your program.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Prince




PostPosted: Thu Mar 27, 2003 7:34 pm   Post subject: (No subject)

heres the simplest loop u can use

code:

var key:string(1)
loop
   %
   %
   % ur code here
   %
   %
   put "again? [y/n] "
   getch (key)
   exit when key="n" or key="N"
end loop


easy, no?
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: