Click to See Complete Forum and Search --> : GAME


meera joseph
February 21st, 2000, 05:33 AM
Hi,
Please send the VB 5.0 code and form layout for the following game:
Write a program in which the computer selects a random number(between 0 and 10 ) and the player needs to guess what the number is. Check if the number is too low too high or incorrect.Reply to meera@twrinet.twr.ac.za
Thanks in advance
meera

Kyle Burns
February 21st, 2000, 09:20 AM
This looks an awful lot like you want someone to do your homework for you ;). Here's some information that will get you where you need to go:
1) Select Random number between two other numbers.Int((upperbound - lowerbound + 1) * Rnd + lowerbound)

(This was straight out of the help file)
2) Determine whether the guess is the same, higher, or lower than the target number:

Select Case guess
Case target
'The number is the same
'Do whatever you need done
Case < target
'The guess is less than target
'Do something to tell user
Case > target
'The guess is greater than target
'Do something to tell user
End Select



This is everything you need to complete your project.