Computer Science Canada help with numbers game again! |
Author: | marz [ Mon Jun 02, 2003 7:49 pm ] |
Post subject: | help with numbers game again! |
Alright, For this number game that we are doing, we must make the game exit when the user takes 10 guesses. I dont know how to do this, or what codes to use. Here is my programming so far. |
Author: | ShadowStorm [ Mon Jun 02, 2003 9:11 pm ] | ||
Post subject: | |||
Here's the source code of a program i made a while back.. hope this helps...
|
Author: | marz [ Mon Jun 02, 2003 10:23 pm ] |
Post subject: | |
![]() ![]() |
Author: | Dan [ Tue Jun 03, 2003 12:03 am ] |
Post subject: | |
ah, i think his code dose that and i whould hop you know how to chage/add the put stamtes you need. |
Author: | Blade [ Tue Jun 03, 2003 11:18 am ] | ||||
Post subject: | |||||
theres two ways you can do this: first of all you make a variable that contains the amount of guesses and in your case you would set it to ten. in the if statement where you check to see if the's guessed the answer. if its wrong. subtract one from the total giving him 9. use this variable in your put statement to tell them how many you have left. also. in your loop have exit when chances = 0
the other way is to run a decreasing for loop from 10 and also have a condition to exit when he gets the right answer
|
Author: | Andy [ Tue Jun 03, 2003 2:11 pm ] |
Post subject: | |
ha, i made that program on the ti 83 plus calculator |