Exemple #1
0
 // displays the board
 public void DisplayBoard(Board board, int dimensions)
 {
     Console.Write(Environment.NewLine);
     Console.WriteLine(CreateLabel.LabelGridY('A', 'J', "  "));
     Console.Write(Environment.NewLine);
     for (int row = 0; row < dimensions; row++)
     {
         Console.Write(Environment.NewLine);
         Console.Write(row + "  ");
         for (int column = 0; column < dimensions; column++)
         {
             if (board.Equals(row, column, 0))
             {
                 Console.Write(" ~ ");
             }
             else if (board.Equals(row, column, 1))
             {
                 Console.Write(" o ");
             }
             else if (board.Equals(row, column, 2))
             {
                 Console.Write(" x ");
             }
         }
         Console.Write("  " + row);
         Console.Write(Environment.NewLine);
     }
     Console.Write(Environment.NewLine);
     Console.WriteLine(CreateLabel.LabelGridY('A', 'J', "  "));
     Console.Write(Environment.NewLine);
 }