Guess game
eg. A user auto generated a number then pass it to a server to see if it matches the server's, if match server will regenerate another number for guessing. This is the time where my user generated number wont change when i requested for generating another number.
Please make a guess: 7000
Your guess is too large, try again!
Please make a guess: 2456
Congratulations, your guess is correct, well done!
A new number has been generated.
Congratulations, your guess is correct, well done!<<<-- number doesnt change
mikiPosted Dec 30, 2005, 9:00 AM
wad do u mean by reset the number in the catch block? The auto generated number is by entering "a" or "A" then the server will generate a random number
AnttiPosted Dec 27, 2005, 6:04 AM
You must have somewhere in the code a try-catch -block that takes care of the string to number conversion, right? When you enter a non-number, the catch is executed; so reset the number in that catch block.