Attribute VB_Name = "mod_MAIN" Option Explicit ' Quelque Constante. Global Const v_Version = "0.3.2" Global Const iBlack = 0 Global Const iBlue = 1 Global Const iGreen = 2 Global Const iRed = 3 Global Const iWhite = 4 Global Const iYellow = 5 Global Const iMagenta = 6 Global Const iCyan = 7 Global Const iPurple = 8 Global Const iHuman = 0 Global Const iComputer = 1 Global Const iNetwork = 2 Global Const iCorner = 0 Global Const iCenter = 1 Global Const iHorizontal = 2 Global Const iVertical = 3 ' Quelque fonction de l'API. 'Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public Declare Function TextOut Lib "gdi32" Alias "TextOutA" _ (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, _ ByVal lpString As String, ByVal nCount As Long) As Long Type Tab_Ligne Ligne(0 To 41) As Integer End Type Type Position Ligne As Long Col As Long Index As Long End Type Type Piece Busy As Boolean Index As Integer Orientation As Integer End Type Public SMKIMAGEPATH As String ' Chemin ou sont stocker les images. Public GameBackColor As Long ' Couleur du Fond du jeu. Global Tab_Grid(0 To 41) As Tab_Ligne ' Etat des pieces (tous) Public TabPiece() As Piece ' Etat des pieces (vertical, et horizontal) Public LastMove As Piece ' Etat du dernier Move. Public Nombre_IMG As Long ' Nombre total d'images Public My_Width_X As Long ' Largeur de la grille (en centre) Public My_Height_Y As Long ' Hauteur de la grille (en centre) Public Nb_Player As Integer ' Nombre de joueur Public Nb_Player_Old As Integer ' Ancien nombre de joueur (temp) Public CurPlayer As Integer ' Joueur courant Public CurPlayerOpt As Integer ' Joueur courant pour modif options. Public Winner As Integer ' Joueur Gagnant. Public PlayerDefs(1 To 4) As Player ' Definition de player Public DrawGame As Boolean ' Si la game est null ou pas. Public Played As Boolean ' Si le joueur a jouer, ou pas. Public ComputerHavePlayed As Boolean ' Si l'ordi a jouer, ou pas. Public WasGameOver As Boolean ' S'il vient d'avoir une fin de partie. Public BoolSqueeze As Boolean ' Si l'interface sera squeezer ou non. Sub Main() 'Set fso = CreateObject("Scripting.FileSystemObject") 'If Not fso.FolderExists(SMKIMAGEPATH) Then fso.CreateFolder ("C:\Temp") SMKIMAGEPATH = App.Path + "\images\" GameBackColor = "&H0029FFCC" GameBackColor = "&H00808000" Call GenerePlayer Load sht_Game1 sht_Game1.Show Nombre_IMG = 1 My_Width_X = 6 My_Height_Y = 4 BuildGrid My_Width_X, My_Height_Y, BoolSqueeze End Sub