Computer Science Canada I need help finding out how to alter the code in the following way : Within the thread |
Author: | Velocity [ Sun Nov 06, 2011 11:49 am ] | ||
Post subject: | I need help finding out how to alter the code in the following way : Within the thread | ||
What is it you are trying to achieve? I am trying to find out the answer as to what i had wrote below. What is the problem you are having? I am trying figure out how to change the code so that after it finishes scene 1, it will switch to scene 2. I am also trying to figure out how to make it so that when the green light goes on, the car will drive, but when the red light comes it will stop. Describe what you have tried to solve this problem I have tried altering the code in many ways, and have tried to find tutorials around this forum for help. I could not find any tutorials. I have also tried to delete some of the code to possibly make it work, but i am now stumped, and have no clue how to fix either of them. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) Nothing else relevant.
Please specify what version of Turing you are using I am using 4.11a, but i also need it to run on my school computer which is turing 4.01a |
Author: | Velocity [ Sun Nov 06, 2011 12:39 pm ] |
Post subject: | Re: I need help finding out how to alter the code in the following way : Within the thread |
I will give 3 bits <<<< LOL to the answer-(er). |
Author: | Velocity [ Sun Nov 06, 2011 12:57 pm ] |
Post subject: | Re: I need help finding out how to alter the code in the following way : Within the thread |
Bump - Still looking for answer... Thanks to anyone who is trying. |
Author: | Aange10 [ Sun Nov 06, 2011 1:00 pm ] | ||||
Post subject: | Re: I need help finding out how to alter the code in the following way : Within the thread | ||||
Velocity wrote: What is the problem you are having? I am trying figure out how to change the code so that after it finishes scene 1, it will switch to scene 2. I am also trying to figure out how to make it so that when the green light goes on, the car will drive, but when the red light comes it will stop. Okay so lets go one at a time. Velocity wrote: I am trying figure out how to change the code so that after it finishes scene 1, it will switch to scene 2. So how would we let the computer know that we've completed the scene? How about something like
Now, lets tackle your second problem: Velocity wrote: I am also trying to figure out how to make it so that when the green light goes on, the car will drive, but when the red light comes it will stop. Okay, so how could we tell the computer that the light is green or if its red ? Once we tell the computer it's red, how do we stop the car? Or make it stop moving?
|
Author: | Velocity [ Sun Nov 06, 2011 1:13 pm ] | ||
Post subject: | Re: I need help finding out how to alter the code in the following way : Within the thread | ||
I added in the code like you said. The program runs, but it doesn't do anything :O <h1>Im sorry if my inexperienced self did not put it in the correct spots</h1> |
Author: | Aange10 [ Sun Nov 06, 2011 1:23 pm ] | ||
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread | ||
Hmm, do not copy and paste the coding I gave you; the code is written for you to understand it, not to copy and paste it - it doesn't work because it doesn't do anything. Try looking at the coding, one line at a time.
We are saying here that if the scene variable is set to the value of 1 , then we will execute the scene. Which I made a little scene there. We also have something telling us when to exit the scene. Right now It's set to change the scene to 2 when the counter reaches 200. Then I tell the computer to exit when scene is not = to 1 . .. Meaning we are no longer on the first scene. Make sense? |
Author: | Velocity [ Sun Nov 06, 2011 1:33 pm ] |
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread |
ooooh, okay thanks alot! that helped. |
Author: | Aange10 [ Sun Nov 06, 2011 1:53 pm ] |
Post subject: | Re: RE:I need help finding out how to alter the code in the following way : Within the thread |
Velocity @ 6/11/2011, 12:33 pm wrote: ooooh, okay thanks alot! that helped.
No problem. |
Author: | Velocity [ Sun Nov 06, 2011 4:58 pm ] |
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread |
okay, i got it too work thanks alot. |
Author: | Velocity [ Sun Nov 06, 2011 4:59 pm ] |
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread |
but wait, one more thing. What about the red light - stop, green light - go, thing? |
Author: | Aange10 [ Sun Nov 06, 2011 5:34 pm ] | ||
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread | ||
Analyze the code step by step again.
I declared a boolean named red_light. I then set the boolean red_light to false. Now I tell the computer if red_light = true then it stops the car's velocity. After that I said if red_light is false then make the car's velocity to 5. |
Author: | Tony [ Sun Nov 06, 2011 6:25 pm ] | ||
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread | ||
I don't remember, does Turing typecast boolean values into integers?
|
Author: | Aange10 [ Sun Nov 06, 2011 10:53 pm ] | ||||
Post subject: | Re: RE:I need help finding out how to alter the code in the following way : Within the thread | ||||
Tony @ 6/11/2011, 5:25 pm wrote: I don't remember, does Turing typecast boolean values into integers?
considering
Doesn't work, I'll assume not. |
Author: | Tony [ Sun Nov 06, 2011 11:03 pm ] | ||
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread | ||
aww, sad. Though apparently you can have this magic -- via boolean
|
Author: | Velocity [ Tue Nov 08, 2011 6:51 pm ] |
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread |
This may be more off topic than on topic, but... Tony you work for or host the DWITE contest right? cause im going there first time this year for my school, is it worthwhile? |
Author: | Tony [ Tue Nov 08, 2011 7:28 pm ] |
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread |
Yes, I'm one of the admins for DWITE. This is rather off-topic, so PM me if you have some particular questions. In short, it leaves you in a much better shape for CCC, which is beneficial for your University application (especially UWaterloo). It's also a neat way to push yourself above the curriculum. |
Author: | Velocity [ Wed Nov 09, 2011 3:23 pm ] |
Post subject: | RE:I need help finding out how to alter the code in the following way : Within the thread |
okay thank-you so much ![]() |