int |
Pearls.getNextColumn(int row,
int col,
Direction dir,
boolean doPortalJump) |
Helper method returns the next column for a state sequence in the given
direction, possibly wrapping around.
|
int |
Pearls.getNextRow(int row,
int col,
Direction dir,
boolean doPortalJump) |
Helper method returns the next row for a state sequence in the given
direction, possibly wrapping around.
|
State[] |
Pearls.getStateSequence(Direction dir) |
Finds a valid state sequence in the given direction starting with the player's
current position and ending with a boundary cell as defined by the method
State.isBoundary .
|
MoveRecord[] |
Pearls.move(Direction dir) |
Performs a move along a state sequence in the given direction, updating the score,
the move count, and all affected cells in the grid.
|
int |
PearlUtil.movePlayer(State[] states,
MoveRecord[] records,
Direction dir) |
Updates the given state sequence to be consistent with shifting the
"player" to the right as far as possible.
|
void |
Pearls.setStateSequence(State[] states,
Direction dir,
int playerIndex) |
Sets the given state sequence and
updates the player position.
|