1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
| Public Class Form1
Private Sub But_Chiffmyst_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles But_Chiffmyst.Click
Dim Chiffmyst As Integer
Chiffmyst = InputBox("Saisissez un chiffre mystere entre 0 et 9")
End Sub
Private Sub But_Niveau_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles But_Niveau.Click
Dim Niveau As Integer
Dim Chance As String
Niveau = InputBox("Saisissez 1 pour Expert, 2 pour Moyen ou 3 pour Facile")
If Niveau = 1 Then Chance = 1
If Niveau = 2 Then Chance = 3
If Niveau = 3 Then Chance = 1
End Sub
Private Sub But_Play_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles But_Play.Click
Dim Chiffrep As Integer
Dim Niveau As Integer
Dim Chance As Integer
Dim Chiffmyst As Integer
Dim Essai As Integer
Essai = 0
Do
Chiffrep = InputBox("Saisissez le chiffre de votre choix entre 0 et 9")
Essai = Essai + 1
If Niveau = 3 Then
If Chiffrep > Chiffmyst Then
MsgBox("Trop Elevé")
MsgBox("Trop Bas")
End If
End If
If Chiffrep <> Chiffmyst Then
MsgBox("Vous avez encore,", Chance - Essai, "Chance(s)")
End If
Loop While Chiffmyst = Chiffrep
If Chiffmyst = Chiffrep Then
MsgBox("Vous avez gagné")
MsgBox("Vous perdu")
End If
End Sub
End Class |
Partager