Je vous présente ici, un jeux, le Puissance 4 (6 lignes par 7 colonnes) ; Le code est (trop) long et n'est pas simplifié,
mais malgré qu'il ne puisse pas encore détecter une victoire, il est fonctionnel et mine de rien, ça passe le temps
(Il faut cliquer sur les boutons du haut, et ça s'empile)
Je vous le laisses donc et libre à vous de l'optimiser si l'envie vous prend.
Le voici (ancien):
► Afficher le texte
Code : Tout sélectionner
#cs
Nom du programme : Puissance 4
Auteur : Spiikesan
Date : 30 mars 2012 12:37
#ce
#NoTrayIcon
;~ ====================
;~ - Incudes
;~ ====================
#include <guiconstants.au3>
#include <ButtonConstants.au3>
#Include <Misc.au3>
;~ ====================
;~ - Variables
;~ ====================
$tB = 52 ; Taille des cases
$loop = True
$j = 1
$La = 7 ;Horizontal
$lo = 6 ;Vertical
$Co1 = 0
$Co2 = 0
$Co3 = 0
$Co4 = 0
$Co5 = 0
$Co6 = 0
$Co7 = 0
; $ibt = 0 -> Rond vide, $ibt = 1 -> Rond rouge, $ibt = 2 -> Rond jaune
$guiPrincipal = GUICreate("Puissance 4", $La*$tB, $lo*$tB+40)
$gamer = GUICtrlCreateLabel("C'est au joueur 1 de commencer.", 0, 6*$tB+2)
;~ Conception du plateau
;~ Ligne 1/6
$fichier = GUICtrlCreateMenu("&Fichier")
$rejouer = GUICtrlCreateMenuItem("&Rejouer", $fichier)
$b1_1 = GUICtrlCreateButton("1", 0, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt1_1 = 0
$b2_1 = GUICtrlCreateButton("2", $tB, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt2_1 = 0
$b3_1 = GUICtrlCreateButton("3", 2*$tB, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt3_1 = 0
$b4_1 = GUICtrlCreateButton("4", 3*$tB, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt4_1 = 0
$b5_1 = GUICtrlCreateButton("5", 4*$tB, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt5_1 = 0
$b6_1 = GUICtrlCreateButton("6", 5*$tB, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt6_1 = 0
$b7_1 = GUICtrlCreateButton("7", 6*$tB, 0, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt7_1 = 0
;~ Ligne 2/6
$b1_2 = GUICtrlCreateButton("1", 0, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt1_2 = 0
$b2_2 = GUICtrlCreateButton("2", $tB, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt2_2 = 0
$b3_2 = GUICtrlCreateButton("3", 2*$tB, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt3_2 = 0
$b4_2 = GUICtrlCreateButton("4", 3*$tB, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt4_2 = 0
$b5_2 = GUICtrlCreateButton("5", 4*$tB, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt5_2 = 0
$b6_2 = GUICtrlCreateButton("6", 5*$tB, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt6_2 = 0
$b7_2 = GUICtrlCreateButton("7", 6*$tB, $tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt7_2 = 0
;~ Ligne 3/6
$b1_3 = GUICtrlCreateButton("1", 0, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt1_3 = 0
$b2_3 = GUICtrlCreateButton("2", $tB, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt2_3 = 0
$b3_3 = GUICtrlCreateButton("3", 2*$tB, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt3_3 = 0
$b4_3 = GUICtrlCreateButton("4", 3*$tB, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt4_3 = 0
$b5_3 = GUICtrlCreateButton("5", 4*$tB, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt5_3 = 0
$b6_3 = GUICtrlCreateButton("6", 5*$tB, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt6_3 = 0
$b7_3 = GUICtrlCreateButton("7", 6*$tB, 2*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt7_3 = 0
;~ Ligne 4/6
$b1_4 = GUICtrlCreateButton("1", 0, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt1_4 = 0
$b2_4 = GUICtrlCreateButton("2", $tB, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt2_4 = 0
$b3_4 = GUICtrlCreateButton("3", 2*$tB, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt3_4 = 0
$b4_4 = GUICtrlCreateButton("4", 3*$tB, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt4_4 = 0
$b5_4 = GUICtrlCreateButton("5", 4*$tB, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt5_4 = 0
$b6_4 = GUICtrlCreateButton("6", 5*$tB, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt6_4 = 0
$b7_4 = GUICtrlCreateButton("7", 6*$tB, 3*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt7_4 = 0
;~ Ligne 5/6
$b1_5 = GUICtrlCreateButton("1", 0, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt1_5 = 0
$b2_5 = GUICtrlCreateButton("2", $tB, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt2_5 = 0
$b3_5 = GUICtrlCreateButton("3", 2*$tB, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt3_5 = 0
$b4_5 = GUICtrlCreateButton("4", 3*$tB, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt4_5 = 0
$b5_5 = GUICtrlCreateButton("5", 4*$tB, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt5_5 = 0
$b6_5 = GUICtrlCreateButton("6", 5*$tB, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt6_5 = 0
$b7_5 = GUICtrlCreateButton("7", 6*$tB, 4*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt7_5 = 0
;~ Ligne 6/6
$b1_6 = GUICtrlCreateButton("1", 0, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt1_6 = 0
$b2_6 = GUICtrlCreateButton("2", $tB, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt2_6 = 0
$b3_6 = GUICtrlCreateButton("3", 2*$tB, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt3_6 = 0
$b4_6 = GUICtrlCreateButton("4", 3*$tB, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt4_6 = 0
$b5_6 = GUICtrlCreateButton("5", 4*$tB, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt5_6 = 0
$b6_6 = GUICtrlCreateButton("6", 5*$tB, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt6_6 = 0
$b7_6 = GUICtrlCreateButton("7", 6*$tB, 5*$tB, $tB, $tB, $BS_BITMAP)
GUICtrlSetImage(-1, "Images/PVide.bmp")
$ibt7_6 = 0
GUISetState()
While $loop
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
;~ L1
If $msg = $rejouer Then _rejouer()
If $msg = $b1_1 Then _cocher(1)
If $msg = $b2_1 Then _cocher(2)
If $msg = $b3_1 Then _cocher(3)
If $msg = $b4_1 Then _cocher(4)
If $msg = $b5_1 Then _cocher(5)
If $msg = $b6_1 Then _cocher(6)
If $msg = $b7_1 Then _cocher(7)
Sleep(20)
WEnd
Func _cocher($inp)
Switch $inp
Case 1
If $ibt1_1=0 And $j=1 And $Co1 = 5 Then
GUICtrlSetImage($b1_1, "Images/PRouge.bmp")
$ibt1_1 = 1
$j = 2
$Co1 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_1=0 And $j=2 And $Co1 = 5 Then
GUICtrlSetImage($b1_1, "Images/PJaune.bmp")
$ibt1_1 = 2
$j = 1
$Co1 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_2=0 And $j=1 And $Co1 = 4 Then
GUICtrlSetImage($b1_2, "Images/PRouge.bmp")
$ibt1_2 = 1
$j = 2
$Co1 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_2=0 And $j=2 And $Co1 = 4 Then
GUICtrlSetImage($b1_2, "Images/PJaune.bmp")
$ibt1_2 = 2
$j = 1
$Co1 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_3=0 And $j=1 And $Co1 = 3 Then
GUICtrlSetImage($b1_3, "Images/PRouge.bmp")
$ibt1_3 = 1
$j = 2
$Co1 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_3=0 And $j=2 And $Co1 = 3 Then
GUICtrlSetImage($b1_3, "Images/PJaune.bmp")
$ibt1_3 = 2
$j = 1
$Co1 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_4=0 And $j=1 And $Co1 = 2 Then
GUICtrlSetImage($b1_4, "Images/PRouge.bmp")
$ibt1_4 = 1
$j = 2
$Co1 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_4=0 And $j=2 And $Co1 = 2 Then
GUICtrlSetImage($b1_4, "Images/PJaune.bmp")
$ibt1_4 = 2
$j = 1
$Co1 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_5=0 And $j=1 And $Co1 = 1 Then
GUICtrlSetImage($b1_5, "Images/PRouge.bmp")
$ibt1_5 = 1
$j = 2
$Co1 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_5=0 And $j=2 And $Co1 = 1 Then
GUICtrlSetImage($b1_5, "Images/PJaune.bmp")
$ibt1_5 = 2
$j = 1
$Co1 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_6=0 And $j=1 And $Co1 = 0 Then
GUICtrlSetImage($b1_6, "Images/PRouge.bmp")
$ibt1_6 = 1
$j = 2
$Co1 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt1_6=0 And $j=2 And $Co1 = 0 Then
GUICtrlSetImage($b1_6, "Images/PJaune.bmp")
$ibt1_6 = 2
$j = 1
$Co1 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
Case 2
If $ibt2_1=0 And $j=1 And $Co2 = 5 Then
GUICtrlSetImage($b2_1, "Images/PRouge.bmp")
$ibt2_1 = 1
$j = 2
$Co2 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_1=0 And $j=2 And $Co2 = 5 Then
GUICtrlSetImage($b2_1, "Images/PJaune.bmp")
$ibt2_1 = 2
$j = 1
$Co2 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_2=0 And $j=1 And $Co2 = 4 Then
GUICtrlSetImage($b2_2, "Images/PRouge.bmp")
$ibt2_2 = 1
$j = 2
$Co2 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_2=0 And $j=2 And $Co2 = 4 Then
GUICtrlSetImage($b2_2, "Images/PJaune.bmp")
$ibt2_2 = 2
$j = 1
$Co2 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_3=0 And $j=1 And $Co2 = 3 Then
GUICtrlSetImage($b2_3, "Images/PRouge.bmp")
$ibt2_3 = 1
$j = 2
$Co2 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_3=0 And $j=2 And $Co2 = 3 Then
GUICtrlSetImage($b2_3, "Images/PJaune.bmp")
$ibt2_3 = 2
$j = 1
$Co2 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_4=0 And $j=1 And $Co2 = 2 Then
GUICtrlSetImage($b2_4, "Images/PRouge.bmp")
$ibt2_4 = 1
$j = 2
$Co2 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_4=0 And $j=2 And $Co2 = 2 Then
GUICtrlSetImage($b2_4, "Images/PJaune.bmp")
$ibt2_4 = 2
$j = 1
$Co2 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_5=0 And $j=1 And $Co2 = 1 Then
GUICtrlSetImage($b2_5, "Images/PRouge.bmp")
$ibt2_5 = 1
$j = 2
$Co2 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_5=0 And $j=2 And $Co2 = 1 Then
GUICtrlSetImage($b2_5, "Images/PJaune.bmp")
$ibt2_5 = 2
$j = 1
$Co2 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_6=0 And $j=1 And $Co2 = 0 Then
GUICtrlSetImage($b2_6, "Images/PRouge.bmp")
$ibt2_6 = 1
$j = 2
$Co2 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt2_6=0 And $j=2 And $Co2 = 0 Then
GUICtrlSetImage($b2_6, "Images/PJaune.bmp")
$ibt2_6 = 2
$j = 1
$Co2 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
Case 3
If $ibt3_1=0 And $j=1 And $Co3 = 5 Then
GUICtrlSetImage($b3_1, "Images/PRouge.bmp")
$ibt3_1 = 1
$j = 2
$Co3 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_1=0 And $j=2 And $Co3 = 5 Then
GUICtrlSetImage($b3_1, "Images/PJaune.bmp")
$ibt3_1 = 2
$j = 1
$Co3 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_2=0 And $j=1 And $Co3 = 4 Then
GUICtrlSetImage($b3_2, "Images/PRouge.bmp")
$ibt3_2 = 1
$j = 2
$Co3 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_2=0 And $j=2 And $Co3 = 4 Then
GUICtrlSetImage($b3_2, "Images/PJaune.bmp")
$ibt3_2 = 2
$j = 1
$Co3 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_3=0 And $j=1 And $Co3 = 3 Then
GUICtrlSetImage($b3_3, "Images/PRouge.bmp")
$ibt3_3 = 1
$j = 2
$Co3 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_3=0 And $j=2 And $Co3 = 3 Then
GUICtrlSetImage($b3_3, "Images/PJaune.bmp")
$ibt3_3 = 2
$j = 1
$Co3 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_4=0 And $j=1 And $Co3 = 2 Then
GUICtrlSetImage($b3_4, "Images/PRouge.bmp")
$ibt3_4 = 1
$j = 2
$Co3 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_4=0 And $j=2 And $Co3 = 2 Then
GUICtrlSetImage($b3_4, "Images/PJaune.bmp")
$ibt3_4 = 2
$j = 1
$Co3 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_5=0 And $j=1 And $Co3 = 1 Then
GUICtrlSetImage($b3_5, "Images/PRouge.bmp")
$ibt3_5 = 1
$j = 2
$Co3 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_5=0 And $j=2 And $Co3 = 1 Then
GUICtrlSetImage($b3_5, "Images/PJaune.bmp")
$ibt3_5 = 2
$j = 1
$Co3 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_6=0 And $j=1 And $Co3 = 0 Then
GUICtrlSetImage($b3_6, "Images/PRouge.bmp")
$ibt3_6 = 1
$j = 2
$Co3 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt3_6=0 And $j=2 And $Co3 = 0 Then
GUICtrlSetImage($b3_6, "Images/PJaune.bmp")
$ibt3_6 = 2
$j = 1
$Co3 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
Case 4
If $ibt4_1=0 And $j=1 And $Co4 = 5 Then
GUICtrlSetImage($b4_1, "Images/PRouge.bmp")
$ibt4_1 = 1
$j = 2
$Co4 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_1=0 And $j=2 And $Co4 = 5 Then
GUICtrlSetImage($b4_1, "Images/PJaune.bmp")
$ibt4_1 = 2
$j = 1
$Co4 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_2=0 And $j=1 And $Co4 = 4 Then
GUICtrlSetImage($b4_2, "Images/PRouge.bmp")
$ibt4_2 = 1
$j = 2
$Co4 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_2=0 And $j=2 And $Co4 = 4 Then
GUICtrlSetImage($b4_2, "Images/PJaune.bmp")
$ibt4_2 = 2
$j = 1
$Co4 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_3=0 And $j=1 And $Co4 = 3 Then
GUICtrlSetImage($b4_3, "Images/PRouge.bmp")
$ibt4_3 = 1
$j = 2
$Co4 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_3=0 And $j=2 And $Co4 = 3 Then
GUICtrlSetImage($b4_3, "Images/PJaune.bmp")
$ibt4_3 = 2
$j = 1
$Co4 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_4=0 And $j=1 And $Co4 = 2 Then
GUICtrlSetImage($b4_4, "Images/PRouge.bmp")
$ibt4_4 = 1
$j = 2
$Co4 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_4=0 And $j=2 And $Co4 = 2 Then
GUICtrlSetImage($b4_4, "Images/PJaune.bmp")
$ibt4_4 = 2
$j = 1
$Co4 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_5=0 And $j=1 And $Co4 = 1 Then
GUICtrlSetImage($b4_5, "Images/PRouge.bmp")
$ibt4_5 = 1
$j = 2
$Co4 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_5=0 And $j=2 And $Co4 = 1 Then
GUICtrlSetImage($b4_5, "Images/PJaune.bmp")
$ibt4_5 = 2
$j = 1
$Co4 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_6=0 And $j=1 And $Co4 = 0 Then
GUICtrlSetImage($b4_6, "Images/PRouge.bmp")
$ibt4_6 = 1
$j = 2
$Co4 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt4_6=0 And $j=2 And $Co4 = 0 Then
GUICtrlSetImage($b4_6, "Images/PJaune.bmp")
$ibt4_6 = 2
$j = 1
$Co4 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
Case 5
If $ibt5_1=0 And $j=1 And $Co5 = 5 Then
GUICtrlSetImage($b5_1, "Images/PRouge.bmp")
$ibt5_1 = 1
$j = 2
$Co5 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_1=0 And $j=2 And $Co5 = 5 Then
GUICtrlSetImage($b5_1, "Images/PJaune.bmp")
$ibt5_1 = 2
$j = 1
$Co5 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_2=0 And $j=1 And $Co5 = 4 Then
GUICtrlSetImage($b5_2, "Images/PRouge.bmp")
$ibt5_2 = 1
$j = 2
$Co5 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_2=0 And $j=2 And $Co5 = 4 Then
GUICtrlSetImage($b5_2, "Images/PJaune.bmp")
$ibt5_2 = 2
$j = 1
$Co5 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_3=0 And $j=1 And $Co5 = 3 Then
GUICtrlSetImage($b5_3, "Images/PRouge.bmp")
$ibt5_3 = 1
$j = 2
$Co5 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_3=0 And $j=2 And $Co5 = 3 Then
GUICtrlSetImage($b5_3, "Images/PJaune.bmp")
$ibt5_3 = 2
$Co5 = 4
$j = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_4=0 And $j=1 And $Co5 = 2 Then
GUICtrlSetImage($b5_4, "Images/PRouge.bmp")
$ibt5_4 = 1
$j = 2
$Co5 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_4=0 And $j=2 And $Co5 = 2 Then
GUICtrlSetImage($b5_4, "Images/PJaune.bmp")
$ibt5_4 = 2
$j = 1
$Co5 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_5=0 And $j=1 And $Co5 = 1 Then
GUICtrlSetImage($b5_5, "Images/PRouge.bmp")
$ibt5_5 = 1
$j = 2
$Co5 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_5=0 And $j=2 And $Co5 = 1 Then
GUICtrlSetImage($b5_5, "Images/PJaune.bmp")
$ibt5_5 = 2
$j = 1
$Co5 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_6=0 And $j=1 And $Co5 = 0 Then
GUICtrlSetImage($b5_6, "Images/PRouge.bmp")
$ibt5_6 = 1
$j = 2
$Co5 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt5_6=0 And $j=2 And $Co5 = 0 Then
GUICtrlSetImage($b5_6, "Images/PJaune.bmp")
$ibt5_6 = 2
$j = 1
$Co5 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
Case 6
If $ibt6_1=0 And $j=1 And $Co6 = 5 Then
GUICtrlSetImage($b6_1, "Images/PRouge.bmp")
$ibt6_1 = 1
$j = 2
$Co6 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_1=0 And $j=2 And $Co6 = 5 Then
GUICtrlSetImage($b6_1, "Images/PJaune.bmp")
$ibt6_1 = 2
$j = 1
$Co6 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_2=0 And $j=1 And $Co6 = 4 Then
GUICtrlSetImage($b6_2, "Images/PRouge.bmp")
$ibt6_2 = 1
$j = 2
$Co6 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_2=0 And $j=2 And $Co6 = 4 Then
GUICtrlSetImage($b6_2, "Images/PJaune.bmp")
$ibt6_2 = 2
$j = 1
$Co6 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_3=0 And $j=1 And $Co6 = 3 Then
GUICtrlSetImage($b6_3, "Images/PRouge.bmp")
$ibt6_3 = 1
$j = 2
$Co6 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_3=0 And $j=2 And $Co6 = 3 Then
GUICtrlSetImage($b6_3, "Images/PJaune.bmp")
$ibt6_3 = 2
$j = 1
$Co6 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_4=0 And $j=1 And $Co6 = 2 Then
GUICtrlSetImage($b6_4, "Images/PRouge.bmp")
$ibt6_4 = 1
$j = 2
$Co6 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_4=0 And $j=2 And $Co6 = 2 Then
GUICtrlSetImage($b6_4, "Images/PJaune.bmp")
$ibt6_4 = 2
$j = 1
$Co6 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_5=0 And $j=1 And $Co6 = 1 Then
GUICtrlSetImage($b6_5, "Images/PRouge.bmp")
$ibt6_5 = 1
$j = 2
$Co6 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_5=0 And $j=2 And $Co6 = 1 Then
GUICtrlSetImage($b6_5, "Images/PJaune.bmp")
$ibt6_5 = 2
$j = 1
$Co6 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_6=0 And $j=1 And $Co6 = 0 Then
GUICtrlSetImage($b6_6, "Images/PRouge.bmp")
$ibt6_6 = 1
$j = 2
$Co6 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt6_6=0 And $j=2 And $Co6 = 0 Then
GUICtrlSetImage($b6_6, "Images/PJaune.bmp")
$ibt6_6 = 2
$j = 1
$Co6 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
Case 7
If $ibt7_1=0 And $j=1 And $Co7 = 5 Then
GUICtrlSetImage($b7_1, "Images/PRouge.bmp")
$ibt7_1 = 1
$j = 2
$Co7 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_1=0 And $j=2 And $Co7 = 5 Then
GUICtrlSetImage($b7_1, "Images/PJaune.bmp")
$ibt7_1 = 2
$j = 1
$Co7 = 6
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_2=0 And $j=1 And $Co7 = 4 Then
GUICtrlSetImage($b7_2, "Images/PRouge.bmp")
$ibt7_2 = 1
$j = 2
$Co7 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_2=0 And $j=2 And $Co7 = 4 Then
GUICtrlSetImage($b7_2, "Images/PJaune.bmp")
$ibt7_2 = 2
$j = 1
$Co7 = 5
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_3=0 And $j=1 And $Co7 = 3 Then
GUICtrlSetImage($b7_3, "Images/PRouge.bmp")
$ibt7_3 = 1
$j = 2
$Co7 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_3=0 And $j=2 And $Co7 = 3 Then
GUICtrlSetImage($b7_3, "Images/PJaune.bmp")
$ibt7_3 = 2
$j = 1
$Co7 = 4
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_4=0 And $j=1 And $Co7 = 2 Then
GUICtrlSetImage($b7_4, "Images/PRouge.bmp")
$ibt7_4 = 1
$j = 2
$Co7 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_4=0 And $j=2 And $Co7 = 2 Then
GUICtrlSetImage($b7_4, "Images/PJaune.bmp")
$ibt7_4 = 2
$j = 1
$Co7 = 3
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_5=0 And $j=1 And $Co7 = 1 Then
GUICtrlSetImage($b7_5, "Images/PRouge.bmp")
$ibt7_5 = 1
$j = 2
$Co7 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_5=0 And $j=2 And $Co7 = 1 Then
GUICtrlSetImage($b7_5, "Images/PJaune.bmp")
$ibt7_5 = 2
$j = 1
$Co7 = 2
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_6=0 And $j=1 And $Co7 = 0 Then
GUICtrlSetImage($b7_6, "Images/PRouge.bmp")
$ibt7_6 = 1
$j = 2
$Co7 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
ElseIf $ibt7_6=0 And $j=2 And $Co7 = 0 Then
GUICtrlSetImage($b7_6, "Images/PJaune.bmp")
$ibt7_6 = 2
$j = 1
$Co7 = 1
GUICtrlSetData($gamer, "C'est au joueur " &$j& " de jouer")
EndIf
EndSwitch
EndFunc
Func _rejouer() ;Réinitialise les variables & vide les cases
$j = 1
$Co1 = 0
$Co2 = 0
$Co3 = 0
$Co4 = 0
$Co5 = 0
$Co6 = 0
$Co7 = 0
$ibt1_1 = 0
$ibt2_1 = 0
$ibt3_1 = 0
$ibt4_1 = 0
$ibt5_1 = 0
$ibt6_1 = 0
$ibt7_1 = 0
$ibt1_2 = 0
$ibt2_2 = 0
$ibt3_2 = 0
$ibt4_2 = 0
$ibt5_2 = 0
$ibt6_2 = 0
$ibt7_2 = 0
$ibt1_3 = 0
$ibt2_3 = 0
$ibt3_3 = 0
$ibt4_3 = 0
$ibt5_3 = 0
$ibt6_3 = 0
$ibt7_3 = 0
$ibt1_4 = 0
$ibt2_4 = 0
$ibt3_4 = 0
$ibt4_4 = 0
$ibt5_4 = 0
$ibt6_4 = 0
$ibt7_4 = 0
$ibt1_5 = 0
$ibt2_5 = 0
$ibt3_5 = 0
$ibt4_5 = 0
$ibt5_5 = 0
$ibt6_5 = 0
$ibt7_5 = 0
$ibt1_6 = 0
$ibt2_6 = 0
$ibt3_6 = 0
$ibt4_6 = 0
$ibt5_6 = 0
$ibt6_6 = 0
$ibt7_6 = 0
GUICtrlSetImage($b1_1, "Images/PVide.bmp")
GUICtrlSetImage($b2_1, "Images/PVide.bmp")
GUICtrlSetImage($b3_1, "Images/PVide.bmp")
GUICtrlSetImage($b4_1, "Images/PVide.bmp")
GUICtrlSetImage($b5_1, "Images/PVide.bmp")
GUICtrlSetImage($b6_1, "Images/PVide.bmp")
GUICtrlSetImage($b7_1, "Images/PVide.bmp")
GUICtrlSetImage($b1_2, "Images/PVide.bmp")
GUICtrlSetImage($b2_2, "Images/PVide.bmp")
GUICtrlSetImage($b3_2, "Images/PVide.bmp")
GUICtrlSetImage($b4_2, "Images/PVide.bmp")
GUICtrlSetImage($b5_2, "Images/PVide.bmp")
GUICtrlSetImage($b6_2, "Images/PVide.bmp")
GUICtrlSetImage($b7_2, "Images/PVide.bmp")
GUICtrlSetImage($b1_3, "Images/PVide.bmp")
GUICtrlSetImage($b2_3, "Images/PVide.bmp")
GUICtrlSetImage($b3_3, "Images/PVide.bmp")
GUICtrlSetImage($b4_3, "Images/PVide.bmp")
GUICtrlSetImage($b5_3, "Images/PVide.bmp")
GUICtrlSetImage($b6_3, "Images/PVide.bmp")
GUICtrlSetImage($b7_3, "Images/PVide.bmp")
GUICtrlSetImage($b1_4, "Images/PVide.bmp")
GUICtrlSetImage($b2_4, "Images/PVide.bmp")
GUICtrlSetImage($b3_4, "Images/PVide.bmp")
GUICtrlSetImage($b4_4, "Images/PVide.bmp")
GUICtrlSetImage($b5_4, "Images/PVide.bmp")
GUICtrlSetImage($b6_4, "Images/PVide.bmp")
GUICtrlSetImage($b7_4, "Images/PVide.bmp")
GUICtrlSetImage($b1_5, "Images/PVide.bmp")
GUICtrlSetImage($b2_5, "Images/PVide.bmp")
GUICtrlSetImage($b3_5, "Images/PVide.bmp")
GUICtrlSetImage($b4_5, "Images/PVide.bmp")
GUICtrlSetImage($b5_5, "Images/PVide.bmp")
GUICtrlSetImage($b6_5, "Images/PVide.bmp")
GUICtrlSetImage($b7_5, "Images/PVide.bmp")
GUICtrlSetImage($b1_6, "Images/PVide.bmp")
GUICtrlSetImage($b2_6, "Images/PVide.bmp")
GUICtrlSetImage($b3_6, "Images/PVide.bmp")
GUICtrlSetImage($b4_6, "Images/PVide.bmp")
GUICtrlSetImage($b5_6, "Images/PVide.bmp")
GUICtrlSetImage($b6_6, "Images/PVide.bmp")
GUICtrlSetImage($b7_6, "Images/PVide.bmp")
GUICtrlSetData($gamer, "C'est au joueur 1 de commencer.")
EndFunc
GUIDelete()
Exit
Ci-joint la dernière version du fichier (Code source + éxécutable + fichier de configuration + Dossier images)
Sur ce, je vous souhaite une bonne soirée.