|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.act365.sudoku.Grid
A Grid object represents a partially-filled Su Doku grid.
Constructor Summary | |
Grid()
Creates a dimensionless Su Doku grid. |
|
Grid(int boxesAcross,
int boxesDown)
Creates a Su Doku grid with the given number of boxes (aka subgrids) in each dimension. |
Method Summary | |
java.lang.Object |
clone()
Clones the grid. |
int |
countFilledCells()
Counts the number of filled cells in the grid. |
boolean |
equals(java.lang.Object obj)
Tests for equality. |
Grid |
populate(java.lang.String s)
Populates the grid from a string. |
Grid |
rectify(boolean[][] mask)
Reflects, rotates and rearranges the grid as necessary in order to reduce it to its lowest form. |
void |
reset()
Resets the value of each grid square. |
void |
resize(int boxesAcross,
int boxesDown)
Sets the number of boxes in the Su Doku grid. |
Grid |
shuffle()
Randomly shuffles the current grid. |
int |
solve(IStrategy strategy,
int maxSolns)
Solves the grid. |
java.lang.String |
toString()
Produces a string representation of the grid. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Grid(int boxesAcross, int boxesDown)
public Grid()
Method Detail |
public java.lang.Object clone()
public void resize(int boxesAcross, int boxesDown)
public Grid populate(java.lang.String s)
s
- string in the format created by toString()
public int countFilledCells()
public int solve(IStrategy strategy, int maxSolns)
strategy
- strategy to be usedmaxSolns
- the maximum number of solutions to be sought
public void reset()
public java.lang.String toString()
public boolean equals(java.lang.Object obj)
public Grid rectify(boolean[][] mask)
public Grid shuffle()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |