Number guessing game Here we have a basic number guessing game again showing a random number example this time between 1 and 10. Here is our sample form , have a go. And here is the code for the form and the script .

Can you guess the correct number between 1 and 5

And now for the script <% Dim intRandomNumber , intGuess 'get the number from the form intGuess = Int(Request.Form("guess")) 'generate a random number Randomize intRandomNumber = Int(5 * Rnd+ 1) 'display message based on correct guess or incorrect guess If intRandomNumber = intGuess Then Response.Write "Wa hay You guessed correctly
" Else Response.Write "That is incorrect
" End If 'display the numbers Response.Write "
Your guess was " & intGuess Response.Write "
the number was " & intRandomNumber %>