Sub pile()
Dim x As Integer
Dim i As Integer
Dim score As Integer
Dim p As String, q As String
score = 0
[COLOR="SeaGreen"]' For i = 1 To 10[/COLOR]
[COLOR="Red"]i = 0[/COLOR]
[COLOR="red"]Do[/COLOR]
x = Int((Rnd * 2)) + 1
If x = 1 Then
p = "pile"
Else
p = "face"
End If
q = InputBox("Rentrez pile ou face")
If p = q Then
MsgBox ("bonne réponse")
score = score + 1
Else
MsgBox ("mauvaise réponse")
End If
[COLOR="seagreen"]' Next[/COLOR]
[COLOR="red"] i = i + 1[/COLOR]
[COLOR="red"] recommence = InputBox("voulez vous rejouez O/N")[/COLOR]
[COLOR="red"]Loop While i < 10 And recommence = "O"[/COLOR]
MsgBox ("vous avez gagné" & " " & score & " " & "fois")
End Sub