之前的帖子也有发过。这一次让重新写这个作业,要求是一样的。还是没太搞明白,求大神支援。要求在下面,要读要求,必须是二位char array并且method必须按照他的要求写十分感谢!
• Name the class EightQueens
• Make all the required methods public
• Represent the chessboard as an instance variable, a two-dimensional char array. Use the char Q for a queen and o (lower case letter O) for an empty space
• The class must support a deep copy through a method called clone()
• When an object is created, it should return an empty chessboard (that is, one filled with o)
• getBoard() returns the current state of the chessboard
• setQueen(int row, int column) marks the square as Q
• emptySquare(int row, int column) marks the square as o
• setQueens(int queensRemaining) returns boolean (success or failure of placement). It sets the specified number of queens in allowed positions on the board. Note that the board may already have queens placed on it
• The solution should employ recursion
• Placement of the queens must be calculated by your program, rather than hardcoded