

Private Sub cmd1_Click()
Dim aleatorio1 As Integer, n As Integer
n = Val(InputBox("Insira a sua tentativa"))
If n = 0 Then
resultado = ""
MsgBox "Programa terminado.."
End
End If
Randomize
aleatorio1 = Int(Rnd() * 5) + 1
Do
If aleatorio1 <> n Then
resultado.Caption = "Tente outravez"
n = Val(InputBox("Insira a sua tentativa"))
resultado.Caption = ""
End If
If aleatorio1 = n Then
resultado.Caption = "Acertou!"
MsgBox "Parabéns, Acertou!"
End If
Loop Until aleatorio1 = n Or n = 0
End Sub
Private Sub cmd2_Click()
End
End Sub
Sem comentários:
Enviar um comentário