diff --git a/Program.cs b/Program.cs index 12c65ef..88dc30b 100644 --- a/Program.cs +++ b/Program.cs @@ -1,4 +1,8 @@ -namespace P4 +/// ETML +/// Autheur : Théophile BORBOËN +/// Date : 30.10.2024 +/// Description : Puissance 4 en programmation orientée objet en C# +namespace P4 { // Création d'un enum pour les jetons @@ -379,15 +383,19 @@ int[] boardSize = { 0, 0 }; // initialisation de la taille string[] input = { "", "" }; // initialisation de l'entrée utilisateur // écriture des instructions en couleur grâce à la méthode WriteColor + Console.SetCursorPosition(0, 4); Console.Write("La taille doit être comprise entre "); _program.SetColor(foregroundColor: ConsoleColor.Red); Console.Write("5x6"); _program.SetColor(); Console.Write(" et "); _program.SetColor(foregroundColor: ConsoleColor.Red); - Console.Write("13x16\n"); + Console.WriteLine("13x16"); _program.SetColor(); Console.WriteLine("exemple: 6x7 (6 lignes et 7 colonnes)"); + Console.SetCursorPosition(0, 6); + Console.Write(" "); + Console.SetCursorPosition(0, 6); Console.Write("taille: "); // récupération de l'entrée utilisateur dans une liste grâce à un split @@ -554,9 +562,9 @@ for (int x = 0; x < board.GetLength(0); x++) { // on place le curseur dans chaque case du plateau - Console.SetCursorPosition(leftSpacing + x * 4+2, y*2 + playgroundSpacing + 1); + Console.SetCursorPosition(leftSpacing + x * 4 + 2, y * 2 + playgroundSpacing + 1); // on dessine le jeton qui correspond à la case - Console.Write("{0}", DrawToken(board[x, y])); + Console.Write(DrawToken(board[x, y])); } }