Ejemplo n.º 1
0
        // You move by entering a position in the format row col
        public static char[,] PlayerMoves(this char[,] board)
        {
            Tuple <int, int> xy = board.EnterAMove();
            int x = xy.Item1;
            int y = xy.Item2;

            while (x < 0 || y < 0 || y >= board.GetLength(1) || x >= board.GetLength(0) ||
                   board[x, y] == YOU_PLAYER || board[x, y] == COMPUTER_PLAYER)
            {
                xy = board.EnterAMove();
                x  = xy.Item1;
                y  = xy.Item2;
            }
            board[x, y] = YOU_PLAYER;
            return(board);
        }