Computer Science Canada Number game! |
Author: | bc123 [ Wed Oct 21, 2009 4:28 pm ] | ||
Post subject: | Number game! | ||
Okay on my previous post, I asked how I could make a guessing game and i have completed that but after i went to challenge myself and I added difficulties. So at start u choose 1 for easy, 2 for medium and 3. Hope u like it and also i still want to make it where the var number int is generated so i dont have to assign one myself.. cya ![]()
bye! and if u can change the randint part plz do 8) |
Author: | andrew. [ Wed Oct 21, 2009 4:56 pm ] | ||
Post subject: | RE:Number game! | ||
Where you have number := 73 or 63 or whatever, put in Rand.Int (1, end). 1 is the starting number and end would be the highest number. It will then choose a random number between it. e.g.
|
Author: | ecookman [ Wed Oct 21, 2009 5:08 pm ] | ||
Post subject: | RE:Number game! | ||
Or you can do this
|
Author: | bc123 [ Wed Oct 21, 2009 5:34 pm ] |
Post subject: | RE:Number game! |
ok 1 more thing, test my game and try using medium because alot of times when i press 2 and hit enter it will just endbut sumtimes it works and u can continue with that game... HELP PLZ! |
Author: | bc123 [ Wed Oct 21, 2009 5:43 pm ] |
Post subject: | Re: RE:Number game! |
oops this was i quote but i fixed sumthing but i got and error with 2 still |
Author: | bc123 [ Wed Oct 21, 2009 5:53 pm ] | ||
Post subject: | Re: Number game! | ||
Okay look ive added this but now when u choose your dificulty its glitchy
omg SO LOST! HELP |
Author: | Zren [ Wed Oct 21, 2009 11:45 pm ] | ||||
Post subject: | Re: Number game! | ||||
bc123 @ Wed Oct 21, 2009 5:53 pm wrote: Okay look
ive added this but now when u choose your dificulty its glitchy
omg SO LOST! HELP Why's that there? Remove it and it works. Also, you realize that it's possible to find the answer no matter what in a matter of 6 attempts. All you need to do is guess halfway between the ranges. It's basic recursion (for when you learn it). Say it's 1 Guess: 50, 25, 12, 6, 3, 2, 1 Another thing.
This will make the entire canvas black instead of leaving the white patches. |
Author: | bc123 [ Thu Oct 22, 2009 1:54 pm ] | ||
Post subject: | Re: Number game! | ||
Ok i think i got it all to work!! wooot lmao here it is
i dont think theres any glitches, it should all be working fine, if there is errors pleace let me know |
Author: | BigBear [ Thu Oct 22, 2009 4:35 pm ] |
Post subject: | RE:Number game! |
Why do you have it say "Higher" when you guess it right? Also try using elsif |
Author: | DemonWasp [ Thu Oct 22, 2009 6:14 pm ] |
Post subject: | RE:Number game! |
I'd also like to point out that you can always guess the number in 7 guesses if you follow a decent strategy. |