Esempio n. 1
0
 public static void DeleteLastPlayerChoices()
 {
     System.Threading.Thread.Sleep(2000);
     Ex02.ConsoleUtils.Screen.Clear();
     GameDataMatrix.SetDisplayMatrix(m_FirstCellPick[0], m_FirstCellPick[1], ' ');
     GameDataMatrix.SetDisplayMatrix(m_SecondCellPick[0], m_SecondCellPick[1], ' ');
     DrawBoard.CreateBoard();
 }
Esempio n. 2
0
        private static void initializeGame()
        {
            UI.StartGame();
            GameDataMatrix gdm = new GameDataMatrix();

            DrawBoard.CreateBoard();
            GameLogic.m_GameTurn = 0;

            if (Utils.SecondPlayer == "computer")
            {
                ComputerPlayer.StartComputer();
            }
        }
Esempio n. 3
0
        public static void UpdateBoard(byte i_RowIndexLetter, byte i_ColIndexLetter)
        {
            Ex02.ConsoleUtils.Screen.Clear();
            char columnLetter = 'A';

            for (byte i = 0; i <= Utils.BoardHeight; i++)
            {
                string        rowNumber    = i == 0 ? string.Format("       ", i) : string.Format("  {0}   |", i);
                StringBuilder boardRecords = new StringBuilder(rowNumber);
                StringBuilder boardBorders = new StringBuilder("      ");

                for (byte j = 0; j < Utils.BoardWidth; j++)
                {
                    if (i == 0)
                    {
                        boardRecords.Append(string.Format("   {0}    ", columnLetter));
                        columnLetter++;
                    }
                    else if (i == i_RowIndexLetter + 1 && j == i_ColIndexLetter)
                    {
                        GameDataMatrix.SetDisplayMatrix((byte)(i - 1), j, GameDataMatrix.DataMatrix[i - 1, j]);
                        string cell = string.Format("   {0}   |", GameDataMatrix.DisplayMatrix[i - 1, j]);
                        boardRecords.Append(cell);
                    }
                    else
                    {
                        string cell = string.Format("   {0}   |", GameDataMatrix.DisplayMatrix[i - 1, j]);
                        boardRecords.Append(cell);
                    }

                    boardBorders.Append("========");
                }

                Console.WriteLine(boardRecords);
                Console.WriteLine(boardBorders);
            }
        }