JEUX DE ROULETTE DE CASINO

DolfinCry Messages postés 25 Date d'inscription lundi 14 janvier 2002 Statut Membre Dernière intervention 7 octobre 2002 - 17 janv. 2002 à 02:20
DolfinCry Messages postés 25 Date d'inscription lundi 14 janvier 2002 Statut Membre Dernière intervention 7 octobre 2002 - 17 janv. 2002 à 23:47
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/2443-jeux-de-roulette-de-casino

DolfinCry Messages postés 25 Date d'inscription lundi 14 janvier 2002 Statut Membre Dernière intervention 7 octobre 2002
17 janv. 2002 à 23:47
Si tu veux mais moi, je voulais un effet d'attente, comme une vrai machine a boule, ce que j'ai pas avec le tien mais je crois que si on rajoute des DoEvents, on pourrais avoir l'effet rechercher
cs_khalilo Messages postés 71 Date d'inscription jeudi 17 janvier 2002 Statut Membre Dernière intervention 12 mai 2004
17 janv. 2002 à 12:49
Ton prog est pas mal mais je amélioré le code:

Private Sub cmdstart_Click()
Dim intQte As Single
Dim nb(3)
lblgains2.Visible = False
lblgains.Visible = False
lblgains2.Caption = ""
lblgains.Caption = ""

Randomize 'random pour le défilement des nombres
nb(0) = Int(Rnd * 10)
nb(1) = Int(Rnd * 10)
nb(2) = Int(Rnd * 10)
nb(3) = Int(Rnd * 10)
For i = 0 To 3
For n = 0 To nb(i)
lbl7(i).Caption = n
For j = 0 To 200
DoEvents
DoEvents
DoEvents
DoEvents
DoEvents
Next
Next
Next
'Calcul du nombre de 7

intQte = 0
For i = 0 To 3
If lbl7(i).Caption = 7 Then
intQte = intQte + 1
End If
Next
'Affichage du montant gagné

If intQte = 4 Then
lblgains.Caption = Format(Val(lblgains.Caption) + 500, "currency")
lblgains.Visible = True
ElseIf intQte = 3 Then
lblgains.Caption = Format(Val(lblgains.Caption) + 100, "currency")
lblgains.Visible = True
ElseIf intQte = 2 Then
lblgains.Caption = Format(Val(lblgains.Caption) + 10, "currency")
lblgains.Visible = True
ElseIf intQte = 1 Then
lblgains.Caption = Format(Val(lblgains.Caption) + 2, "currency")
lblgains.Visible = True
Else
lblgains2.Caption = "Vous n'avez rien gagné..."
lblgains2.Visible = True
End If

'Diminution de 2$ a chaque partie

lblsolde.Caption = Val(lblsolde.Caption) - 2

lblsolde.Caption = Val(lblsolde.Caption) + Val(lblgains.Caption)

lblsolde.Caption = Format(lblsolde.Caption, "currency")

'Si vous n'avez plus d'argent, vous devez remiser ou partir

If lblsolde.Caption <= 0 Then
MsgBox "VOUS N'AVEZ PLUS D'ARGENT, LA BANQUE CONTINUE SON BON TRAVAIL", vbCritical, "Banqueroute"
choix = MsgBox("Voulez vous remiser?", vbYesNo, "Remiser?")
If choix = vbNo Then
End
Else
txtmise.Enabled = True
txtmise.Text = ""
txtmise_gotfocus
End If
End If

End Sub
DolfinCry Messages postés 25 Date d'inscription lundi 14 janvier 2002 Statut Membre Dernière intervention 7 octobre 2002
17 janv. 2002 à 02:20
il vous faudrais toujours changer de nom
Ex:. a1
a2
a3...
Rejoignez-nous