|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.game.puzzle.DiceEquation
public class DiceEquation
a tiny game that allows to find certain calculations based on a predefined set of numbers and operators to generate a given number.
| Constructor Summary | |
|---|---|
DiceEquation(double goal,
int... dice)
|
|
| Method Summary | |
|---|---|
double |
calculate()
|
long |
count()
|
boolean |
getAllowRoot()
|
int[] |
getDice()
|
double |
getGoal()
|
boolean |
gotoNext()
|
boolean |
isSolution()
|
static void |
main(String[] args)
|
boolean |
nextSolution()
|
boolean |
nextSolution(Monitor mon)
some solutions returned hereby look the same as they falsely distinguish the order of dices; use printPath() to get a unique representatino |
int |
numberOfSolutions()
should be performed only directly after construction or reset() |
String |
printPath()
|
void |
reset()
|
void |
setAllowRoot(boolean flag)
should only be set before any other state is changed |
static void |
standardIteration(int goal,
Writer writer)
iterates through all combinations of the standard 5 dices and writes a tab-separated format along with the number of possible solutions for that combination for the given goal. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DiceEquation(double goal,
int... dice)
| Method Detail |
|---|
public void reset()
public int numberOfSolutions()
public void setAllowRoot(boolean flag)
public boolean getAllowRoot()
public double getGoal()
public int[] getDice()
public String printPath()
public boolean isSolution()
public double calculate()
public boolean nextSolution()
public boolean nextSolution(Monitor mon)
public long count()
public boolean gotoNext()
public static void standardIteration(int goal,
Writer writer)
throws Exception
Exceptionpublic static void main(String[] args)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||