Ejemplo n.º 1
0
        // The function that starts the game
        private static void startGame()
        {
            Dialog.openingDialog();
            Dialog.rules();
            bool flip = Dialog.flipCoin();

            player.setIsFirst(flip);
            computer.setIsFirst(!flip);
            // Keep playing the game as long as the board is not full.
            while (!board.isFull())
            {
                // Compuer making the first move
                if (computer.getIsFirst())
                {
                    computerTurn();
                    playerTurn();
                }
                // Player making the first move
                else
                {
                    playerTurn();
                    computerTurn();
                }
            }
        }