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

Username:   Password: 
 RegisterRegister   
 Recurrsion in main menu
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
isaiahk9




PostPosted: Sat May 24, 2008 8:52 am   Post subject: Recurrsion in main menu

In my main menu for my game, there is the main screen. From the main screen you can go to the instructions ("instructions.t") or the credits ("credits.t"). Problem is that you can go back from the credits and instructions to the main menu, and that is recursion according to Turing - it cannot be done without error. It can be done in Java, but Turing just sends an error. Does anybody know how to make it so that I could still go from the file "mainmenu.t" to "instructions.t" or "credits.t", and then go back?
thanx
Sponsor
Sponsor
Sponsor
sponsor
zylum




PostPosted: Sat May 24, 2008 5:00 pm   Post subject: RE:Recurrsion in main menu

First off, recursion can be done in turing (there is a tutorial on it). Second, it would only be (mutual) recursion if it involved one function calling another and the other calling the first again and so on. This is not how you should be implementing your game anyways. Your instructions method or credits method should be called from the main loop and then return or even change a game variable which changes the game's state. There are many ways of accomplishing this, mutual recursion isn't one of the better ones.
isaiahk9




PostPosted: Sat May 24, 2008 6:15 pm   Post subject: RE:Recurrsion in main menu

thanx. Looked in tutorials, found what I wanted. kind of ironic, recursion was the problem, not what I wanted.
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: