- Home
·
- Games
·
- Random number guessing game. You have 10 tries to guess the number that is between 1 and 100.
Random number guessing game. You have 10 tries to guess the number that is between 1 and 100.
Random number guessing game. You have 10 tries to guess the number that is between 1 and 100.
Rate Random number guessing game. You have 10 tries to guess the number that is between 1 and 100.
(1(1 Vote))
Private Sub Command1_Click()
If Abs(Val(Text1.Text) - Star) <= 5 Then
Label1.Caption = "You are five or less numbers away"
ElseIf Abs(Val(Text1.Text) - Star) <= 10 Then
Label1.Caption = "You are ten or less numbers away"
ElseIf Text1.Text = Star Then
Label1.Caption = "Good Job"
ElseIf (Val(Text1.Text) - Star) <= 11 Then
Label1.Caption = "Too Low"
ElseIf (Val(Text1.Text) - Star) >= -11 Then
Label1.Caption = "Too High"
End If
If Label1.Caption = "Good Job" Then
Command2.Enabled = True
End If
Counter = Counter + 1
If Counter = 10 Then
Label1.Caption = "You Lose"
Command2.Enabled = True
Label2.Caption = Star
Counter = 0
End If
If Label2.Visible = True Then
Command2.Visible = True
End If
End Sub
Private Sub Command2_Click()
Unload Form1
Load Form1
Form1.Show
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Randomize
Star = Int((100 * Rnd) + 1)
End Sub
Random number guessing game. You have 10 tries to guess the number that is between 1 and 100. Comments
No comments yet — be the first to post one!
Post a Comment