Exemplo n.º 1
0
        public bool IsValidMove(int[] coordinate, TicTacToe.BoardPiece boardPiece)
        {
            currBoardPiece = boardPiece;

            if (coordinate[0] > 3 || coordinate[1] > 3)
            {
                Console.WriteLine("One of the coordinates you entered is out of bounds.");
                return(false);
            }

            if ((int)grid[coordinate[0], coordinate[1]] != 0)
            {
                Console.WriteLine("That space is already taken.");
                return(false);
            }

            grid[coordinate[0], coordinate[1]] = currBoardPiece;
            return(true);
        }
Exemplo n.º 2
0
 public Player(string name, TicTacToe.BoardPiece boardPiece)
 {
     this.name       = name;
     this.boardPiece = boardPiece;
 }