|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.game.AbstractGame
org.jscience.computing.game.puzzle.WSPuzzle
public class WSPuzzle
WSPuzzle implements the 'Wolf & Sheep Puzzle'. This puzzle is inspired by
http://www.fitzweb.com/brainteasers/wolves.shtml
The solution can be easily found by searching through 6379 game positions.
| Field Summary | |
|---|---|
static byte |
SHEEP
DOCUMENT ME! |
static byte |
WOLF
DOCUMENT ME! |
| Constructor Summary | |
|---|---|
WSPuzzle()
Creates a new WSPuzzle object. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
DOCUMENT ME! |
int[] |
getWinner()
DOCUMENT ME! |
protected GameMove[] |
listLegalMoves()
lists all legal moves. |
static void |
main(java.lang.String[] args)
solves the puzzle and then fires up a GUI to let you examine the solution |
int |
nextPlayer()
DOCUMENT ME! |
protected boolean |
popMove()
DOCUMENT ME! |
protected boolean |
pushMove(GameMove move)
DOCUMENT ME! |
static GamePlay |
searchSolution()
tries to solve the puzzle with GameUtils functions |
java.lang.String |
toString()
DOCUMENT ME! |
| Methods inherited from class org.jscience.computing.game.AbstractGame |
|---|
clearRedoList, gameOver, getGameName, getLastMove, getLastPlayer, getLegalMoves, getLegalMoves, getMoveHistory, getNumberOfRedoMoves, getRedoList, getResult, isLegalMove, isWinner, loadFromFile, makeMove, numberOfMoves, numberOfPlayers, redoMove, resetLegalMoves, resetLists, saveToFile, spawnChild, undoLastMove, undoMoves |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final byte WOLF
public static final byte SHEEP
| Constructor Detail |
|---|
public WSPuzzle()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
args - DOCUMENT ME!public static GamePlay searchSolution()
protected GameMove[] listLegalMoves()
listLegalMoves in class AbstractGameprotected boolean pushMove(GameMove move)
pushMove in class AbstractGamemove - DOCUMENT ME!
protected boolean popMove()
popMove in class AbstractGamepublic int nextPlayer()
public int[] getWinner()
public java.lang.String toString()
toString in class AbstractGame
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface GamePlayclone in class AbstractGamejava.lang.CloneNotSupportedException - DOCUMENT ME!AbstractGame.spawnChild(GameMove)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||