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

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




PostPosted: Sun May 25, 2008 7:21 pm   Post subject: How to rerun the program?

I have another question about how to rerun the program
Sponsor
Sponsor
Sponsor
sponsor
gitoxa




PostPosted: Sun May 25, 2008 7:39 pm   Post subject: RE:How to rerun the program?

Stick the entire program (Minus the variable declarations) and put it into a loop.

That being said, any initializations done need to be in the loop as well.
syntax_error




PostPosted: Sun May 25, 2008 10:06 pm   Post subject: Re: How to rerun the program?

code:

var gah
var boo
var hoo
process hahaNot

loop

hahaNot
get gah * hoo

if boo = no then exit
end loop
Saad




PostPosted: Mon May 26, 2008 6:22 am   Post subject: Re: How to rerun the program?

syntax_error @ Sun May 25, 2008 10:06 pm wrote:
code:

var gah
var boo
var hoo
process hahaNot

loop

hahaNot
get gah * hoo

if boo = no then exit
end loop


How is that helpful? I mean
A) It doesn't run
B) Theres no way to follow what your doing

To the Original Poster

Loop the program and exit if you don't want to continue

Example
Turing:
loop
    put "Type exit to stop"
    var input : string
    get input
    exit when input = "exit"  %% If the input was "exit" then we are going to kick ourselves out of the loop
end loop
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: