|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Configuration
A Configuration represents an arrangement of pieces within the box.
| Field Summary | |
static int |
examined
|
static int |
maxDistance
maximum required solution length found so far |
static InputSpec |
spec
the input specifications |
| Constructor Summary | |
Configuration()
Make a new, empty configuration. |
|
Configuration(Configuration config)
Make a copy of an existing configuration. |
|
| Method Summary | |
boolean |
equals(Configuration config)
Does this configuration have the same piece shapes and locations as another configuration? |
boolean |
occupied(int x,
int y)
Is the square (x, y) occupied by any piece in this configuration, or by a box wall? (Anything outside the box count as a box wall too.) |
boolean |
placePiece(int shapeIndex,
java.awt.Point where)
Can a piece of a given shape be placed into this configuration with upper left corner at (x, y)? If so, place it there & return true. |
void |
prettyPrint()
Print a configuration for human consumption, in a nice ASCII grid layout. |
void |
printSolution()
Print the solution. |
void |
printSolution2()
|
void |
puzzleSearch(int x,
int y)
Try all possible piece placements at (x, y) (including 'filling' it with empty space), and for each one, recursively try to fill the next spot in the box. |
void |
removePiece()
Remove the last piece added to this configuration. |
void |
solve()
Can this configuration be solved by making some sequence of moves? If so, and the minimum-length solution is longer than the longest found so far, print it out. |
boolean |
solved()
Is this configuration solved? It's solved if the goal piece is in the goal location. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static int examined
public static InputSpec spec
public static int maxDistance
| Constructor Detail |
public Configuration()
public Configuration(Configuration config)
| Method Detail |
public void puzzleSearch(int x,
int y)
public void solve()
public boolean solved()
public void printSolution()
public void printSolution2()
public void prettyPrint()
public boolean placePiece(int shapeIndex,
java.awt.Point where)
public void removePiece()
public boolean occupied(int x,
int y)
public boolean equals(Configuration config)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||