|
-
February 21st, 2000, 06:33 AM
#1
GAME
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 [email protected]
Thanks in advance
meera
-
February 21st, 2000, 10:20 AM
#2
Re: GAME
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|