Computer Science Canada

Number Guessing Game

Author:  didsbub [ Thu Dec 08, 2005 5:11 pm ]
Post subject:  Number Guessing Game

A simple number guessing game

Author:  Clayton [ Wed Jan 11, 2006 8:27 pm ]
Post subject: 

your program has a simple problem with it, if you choose to play again after playing once, your random number does not reset to another random number so someone can play until the cows come home inputting the same number over and over again always winning i also suggest some character graphics to make it more interesting Cool

Author:  yoink78 [ Sun Jan 15, 2006 11:52 am ]
Post subject: 

That's a simple fix. After the line:
code:
loop
make a line that says:
code:
number := Rand.Int (1,50)
that way a new number is chosen each time the for loop is executed.

Author:  cool dude [ Sun Jan 15, 2006 1:56 pm ]
Post subject: 

error proofing is good too. if u enter a letter your program crashes. also when it says would u like to play again and u enter any letter it will play again, but wat u should have instead is if they enter somethin other than yes or no then it should prompt the user saying invalid answer or somthin like that. for error proofing check out the turing tutorial.

Author:  Clayton [ Mon Jan 16, 2006 2:26 am ]
Post subject: 

cool dude wrote:
error proofing is good too. if u enter a letter your program crashes. also when it says would u like to play again and u enter any letter it will play again, but wat u should have instead is if they enter somethin other than yes or no then it should prompt the user saying invalid answer or somthin like that. for error proofing check out the turing tutorial.


a simple way to program that little problem is this
code:

%this will just keep going until an appropriate input has been made
loop
     get answer
     exit when answer = "y" or answer = "Y" or answer = "n" or answer = "N"
end loop


: