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

Username:   Password: 
 RegisterRegister   
 From "Instructions" to Main Menu to UserInput1
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
shakin cookie




PostPosted: Wed Jan 02, 2008 1:59 pm   Post subject: From "Instructions" to Main Menu to UserInput1

Hey everyone, there is a bit of difficulty i have run into with the game i am making.

I have a main menu, and when instructions is selected( a 4 is entered,) there is a program pause and then main menu. Now, none of the options work.

Here is my main program: mainMenu
userInput1
i suspect that there is something i have to do with a loop but i cannot figure it out...



Unnamed.t
 Description:

Download
 Filename:  Unnamed.t
 Filesize:  2.9 KB
 Downloaded:  137 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Zampano




PostPosted: Wed Jan 02, 2008 2:43 pm   Post subject: Re: From "Instructions" to Main Menu to UserInput1

The reason userinput1 does not occur more than once is that it is only called once (in the last line of the program). Therefore when the program first begins to run, introduction, then mainMenu, and finally userInput1 run. However, when you are calling those same procedures from inside the "elsif choice = 4" section of userinput1, you only call MainMenu, not userInput1, meaning that only mainMenu will execute. What you should do is call them both at once instead of only the one. The problem has absolutely nothing to do with any sort of loop.
On another note, you might want to compress some of those procedures into a lesser amount so that the code is easier to understand. For example, mainMenu and userInput1 never execute without being beside each other so their being in seperate procedures is pretty redundant. You might also want to eliminate pauseProgram in favour of Input.Pause. Lastly, please name userinput1 'userinput2' (because that's what it is) and mainMenu 'userinput1'.
shakin cookie




PostPosted: Wed Jan 02, 2008 2:57 pm   Post subject: RE:From "Instructions" to Main Menu to UserInput1

thank you zampano

i will try these things
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: