Computer Science Canada Need help with a quick code |
Author: | rocknroller [ 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 |
Author: | apomb [ 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 |
Author: | syntax_error [ 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. |
Author: | talyboy [ 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. |
Author: | maxudaskin [ 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] |
Author: | jeffgreco13 [ 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. |
Author: | Insectoid [ 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. |
Author: | pkjr92 [ 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. |
Author: | Aziz [ 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. |