|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object smithers.logicpuzzles.AbstractPuzzleSolver<Slitherlink,SlitherlinkState> smithers.logicpuzzles.SlitherlinkSolver
public class SlitherlinkSolver
Solver for slitherlink puzzles.
Field Summary |
---|
Fields inherited from class smithers.logicpuzzles.AbstractPuzzleSolver |
---|
puzzle, state |
Constructor Summary | |
---|---|
SlitherlinkSolver(Slitherlink puzzle)
Creates a new solver for the specified puzzle. |
|
SlitherlinkSolver(SlitherlinkState state)
Creates a new solver to work from the specified state. |
Method Summary | |
---|---|
SlitherlinkState |
makeState(Slitherlink puzzle)
Makes a new state for the specified puzzle. |
boolean |
nextStep()
Advances to the next step of solving the puzzle. |
int |
solveStep()
Attempts to solve the current step of the puzzle. |
void |
start()
Restarts the solving process. |
Methods inherited from class smithers.logicpuzzles.AbstractPuzzleSolver |
---|
getPuzzle, getState, pass, solve, step |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SlitherlinkSolver(Slitherlink puzzle)
puzzle
- the puzzle to solvepublic SlitherlinkSolver(SlitherlinkState state)
state
- the puzzle state to work fromMethod Detail |
---|
public SlitherlinkState makeState(Slitherlink puzzle)
AbstractPuzzleSolver
puzzle
as an argument.
makeState
in class AbstractPuzzleSolver<Slitherlink,SlitherlinkState>
puzzle
- the puzzle to create a state for
public void start()
PuzzleSolver
public int solveStep()
AbstractPuzzleSolver
0
if it made no changes, 1
if it made a change to
its internal data, but no change to the state of the puzzle, or any
number greater than 1
if a change has been made to the state.
solveStep
in class AbstractPuzzleSolver<Slitherlink,SlitherlinkState>
public boolean nextStep()
AbstractPuzzleSolver
nextStep
in class AbstractPuzzleSolver<Slitherlink,SlitherlinkState>
true
iff the solver has started a new 'pass'
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |