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

Username:   Password: 
 RegisterRegister   
 Need help with a quick code
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rocknroller




PostPosted: Sun Jun 08, 2008 1:13 pm   Post subject: Need help with a quick code

Hey guys im just starting turing and I need your help with a quick code

Im just wondering how you would make something for a game at the beginning that says

1. Play
2. Instructions
3. Exit


Then they would enter 1,2, and 3 and it would go to the page they wanted

Sorry if this is a "newbie" question im just kind of new to this stuff
Sponsor
Sponsor
Sponsor
sponsor
apomb




PostPosted: Sun Jun 08, 2008 5:09 pm   Post subject: RE:Need help with a quick code

a) if you're just starting turing, why are you trying to make a game
and
b) make a loop, outputting those options to the screen, then inside that loop make a decision structure (if then else) that does something based on input from the user
syntax_error




PostPosted: Sun Jun 08, 2008 5:15 pm   Post subject: RE:Need help with a quick code

Just to add you can also use another decision structure, called the case structure for more information please use the Turing Walkthrough since it has a a plentiful of examples.
talyboy




PostPosted: Sun Jun 08, 2008 5:35 pm   Post subject: RE:Need help with a quick code

or you could just use a get statement and using an if structure decide what happens then.
maxudaskin




PostPosted: Sun Jun 08, 2008 5:44 pm   Post subject: Re: Need help with a quick code

[Mod Edit: No need to do it for him]
jeffgreco13




PostPosted: Mon Jun 09, 2008 9:26 am   Post subject: Re: Need help with a quick code

Oof, if this is giving you problems then you have a long journey ahead of you if you're going to make a game.

I think you should go read a little, no, A LOT more, if you're going to make a game worth making.

Don't mean to insult but I don't think you should jump into something like this just yet.
Insectoid




PostPosted: Mon Jun 09, 2008 11:13 am   Post subject: RE:Need help with a quick code

I think I should add, the game is first priority. The menu comes after.
pkjr92




PostPosted: Thu Jun 12, 2008 9:10 am   Post subject: Re: Need help with a quick code

Yeah, I when I first used turing, I was confused about how it worked too. It's not like VB where you can move from form to form, you only have one active user-controlled run window and unless you get into procedures, it is better just to flash up the instructions at the beginning of the game, and then go straight to playing it.
Sponsor
Sponsor
Sponsor
sponsor
Aziz




PostPosted: Thu Jun 12, 2008 9:14 am   Post subject: Re: RE:Need help with a quick code

Don't give him the answer, maxudaskin =/. And yes, the Turing Walkthrough thread http://compsci.ca/v3/viewtopic.php?t=8808 would be a great help in this.

Doing the menu should actually come first in this case, because he's going to have to struggle over that first before he can learn ANYTHING about making a game.
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  [ 9 Posts ]
Jump to:   


Style:  
Search: