public static void LaunchGame(int player) { int returnPos = 0; int tours = 0; bool Win = false; Joueur j1; Joueur j2; if (player == 1) { j1 = new JoueurHumain("1", Puissance4.Jeton1, ConsoleColor.Red); j2 = new JoueurHumain("2", Puissance4.Jeton2, ConsoleColor.Yellow); } else { j1 = new JoueurHumain("1", Puissance4.Jeton1, ConsoleColor.Red); j2 = new JoueurIA("2", Puissance4.Jeton2, ConsoleColor.Yellow); } Joueur[] tableauJoueur = { j1, j2 }; Grille g = new Grille(); Affichage.HelpCommand(tableauJoueur); while (tours < 41 && Win == false) { for (int i = 0; i < tableauJoueur.Length; i++) { while (g.PlacerPiont(returnPos - 1, tableauJoueur[i])) { returnPos = tableauJoueur[i].ChoixPosition(); } returnPos = 0; Affichage.AfficheGrille(Grille.Ligne, Grille.Colonne); Win = g.TestWin(tableauJoueur[i]); if (Win) { break; } } } Console.Clear(); Console.WriteLine(Win); }
public Grille() { Console.Clear(); Console.CursorVisible = false; Affichage.AfficheGrille(Ligne, Colonne); }