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

Username:   Password: 
 RegisterRegister   
 Making a restart function
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Sicarius




PostPosted: Mon Dec 16, 2013 6:05 pm   Post subject: Making a restart function

What is it you are trying to achieve?
I'm trying to make it so that when a VAR is equal to 0 that the program will reset and you will have to start from the begining


What is the problem you are having?
I'm not sure how to do this, i assume i will require a loop of some sort and then when the VAR is equal to 0 it exits the loop


Describe what you have tried to solve this problem
Haven't tried to do it because im not sure how


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
loop
delay(200)
mouse % this is a procedure to track where the mouse is at

Pic.Draw (level1,0,0,0)
if x > 40 and x < 360 and y > 150 and y < 220 and button = 1 then
Wrong
delay (500)
lives := lives -1
elsif x > 40 and x < 360 and y > 260 and y < 370 and button = 1 then
Wrong
delay (500)
lives := lives -1
elsif x > 380 and x < 700 and y > 150 and y < 220 and button = 1 then
exit
elsif x > 380 and x < 700 and y > 260 and y < 370 and button = 1 then
Wrong
delay (500)
lives := lives -1
end if

View.Update
delay (20)
cls
end loop

I'm going to have multiple loops so i need something that will work for multiple ones.
Please specify what version of Turing you are using
4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Mon Dec 16, 2013 6:22 pm   Post subject: RE:Making a restart function

You can start by reading about loops via The Turing Walkthrough
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  [ 2 Posts ]
Jump to:   


Style:  
Search: