예제 #1
0
        static void PlayerMove(GameArea area)
        {
            int cellIndex;

            if (player1Turn)
            {
                Console.WriteLine("Payer \"X\" move.");
                cellIndex = InputCheckOfCellNo(area);
                area.GameMoves[cellIndex - 1] = "X";
                player1Turn = false;
            }
            else
            {
                Console.WriteLine("Payer \"0\" move.");
                cellIndex = InputCheckOfCellNo(area);
                area.GameMoves[cellIndex - 1] = "0";
                player1Turn = true;
            }

            turnCount++;
            Console.Clear();
            area.Draw();

            CheckForWin(area);
            CheckForDraw();
        }
예제 #2
0
 static void NewGame(GameArea area)
 {
     area.InitializeGameMoves();
     Console.Clear();
     area.Draw();
     player1Turn = true;
     gameEnded   = false;
     turnCount   = 0;
 }