VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This is a more up to date version of the number guessing game than previously submitted, all you ne

by Christopher Brown (2 Submissions)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 1st September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This is a more up to date version of the number guessing game than previously submitted, all you need is two cmd buttons. cmplay, and cmdquit

API Declarations


Dim guess As Integer
Dim number As Integer
Dim counter As Integer


Rate This is a more up to date version of the number guessing game than previously submitted, all you ne



On Error GoTo Error
Randomize
number = Int(1000 * Rnd) + 1
counter = 0
Do
guess = InputBox("I am thinking of a number please have a guess at what it is.")
If guess > 1000 Then
GoTo Error
End If
If guess = number Then
MsgBox ("Spot on")
End
If guess > number Then
MsgBox ("your guess is too high")
Else
MsgBox ("your guess is too low")
End If
End If
counter = counter + 1
Loop Until counter = 10
MsgBox ("Sorry the number was ") & number
Error:
MsgBox ("Please input a valid number between 1 and 1000 inclusive.")
End Sub
Private Sub cmdquit_Click()
End
End Sub


Download this snippet    Add to My Saved Code

This is a more up to date version of the number guessing game than previously submitted, all you ne Comments

No comments have been posted about This is a more up to date version of the number guessing game than previously submitted, all you ne. Why not be the first to post a comment about This is a more up to date version of the number guessing game than previously submitted, all you ne.

Post your comment

Subject:
Message:
0/1000 characters