Пример #1
0
        private int PlayerMove(TicTacToeMain game)
        {
            int playerInput = game._inputDelegate();

            while (game.IsGameArrayElementTaken(playerInput))
            {
                playerInput = game._inputDelegate();
            }
            return(playerInput);
        }
Пример #2
0
        private int CPUMoveEasy(TicTacToeMain game)
        {
            Random rnd     = new Random();
            int    cpuMove = rnd.Next(1, 10);

            while (game.IsGameArrayElementTaken(cpuMove))
            {
                cpuMove = rnd.Next(1, 10);
            }
            return(cpuMove);
        }