Here is the Code

Sub Guess()

g = Int(Rnd() * 100)

tr = 10
Min = 0
Max = 100

Do While tr _ 0
i = InputBox(“Enter an Number between ” & Min & ” and ” & Max)

If Val(i) = g Then
MsgBox “Congrats you geussed the number”
Exit Sub
Else
If Val(i) _ Min And Val(i) _ g Then Min = Val(i)
If Val(i) _ Max And Val(i) _ g Then Max = Val(i)
End If

tr = tr – 1
Loop

MsgBox “Sorry you didn’t guess the Number ” & g

End Sub

Chris Terrell

View all posts