|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.eriksilkensen.sudoku.GeneratingBoardFactory
public abstract class GeneratingBoardFactory
Ideally, this program would be able to generate valid Sudoku boards on the fly whenever a user asks for one.
This abstract Factory attempts to provide for some of that functionality by delegating the actual creation of the puzzles to subclasses - which each start with a fully filled and generated Board.
As of 02/13/07 this class does not function correctly and should not be used.
| Constructor Summary | |
|---|---|
GeneratingBoardFactory()
|
|
| Method Summary | |
|---|---|
boolean |
attemptToRemoveCell(Cell cell,
Board board,
int row,
int col)
Determines the legality of attemption to remove a given Cell on the Given Board at the given location [row][col]. |
Board |
createBoard(BoardDifficulties difficulty)
This method should not be overridden by subclassing Factories and so it is marked final. |
Cell[] |
getRandomCells(int[] rows,
int[] cols,
Cell[][] cells)
Helper method that can be used to generate some random Cell values |
int[] |
getRandomCoords(int numOfCoords)
Helper method that can be used to generate some random coordinate values |
Board |
leaveClues(int numOfClues,
Board board)
leaveClues() attempts to remove all Cells from a Board leaving the specified number of 'clues,' but isn't accurate enough to be used yet. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeneratingBoardFactory()
| Method Detail |
|---|
public final Board createBoard(BoardDifficulties difficulty)
createBoard in interface BoardFactory
public Board leaveClues(int numOfClues,
Board board)
public boolean attemptToRemoveCell(Cell cell,
Board board,
int row,
int col)
public Cell[] getRandomCells(int[] rows,
int[] cols,
Cell[][] cells)
public int[] getRandomCoords(int numOfCoords)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||