Skip navigation links
A B C D E G I J L M P R S T U V 

A

addPiece(Piece) - Method in class RailroadRushHour
Add a piece to the board.

B

BLANK - Static variable in class RailroadRushHour
character representation for an empty (blank) board space
board - Variable in class Piece
character representation of board
board - Variable in class RailroadRushHour
characters are used to track the occupancy of grid cells

C

canMoveDir(Direction) - Method in class LRPiece
 
canMoveDir(Direction) - Method in class Piece
Return whether or not the piece is, in general, permitted to move in the given direction.
canMoveDir(Direction) - Method in class UDPiece
 
CHAR - Variable in enum Direction
direction character representation

D

D_COL - Variable in enum Direction
direction column change
D_ROW - Variable in enum Direction
direction row change
Direction - Enum in <Unnamed>
Direction - a direction enumeration useful for orthogonal (up, down, right, left) movement direction on a grid.
displayChar - Variable in class Piece
character representing piece

E

expert40() - Static method in class RailroadRushHour
Return the last expert Railroad Rush Hour puzzle, the most difficult of the set.

G

getBottomRow() - Method in class LRPiece
 
getBottomRow() - Method in class LRUDPiece
 
getBottomRow() - Method in class Piece
Return the row of the piece's bottom right corner.
getBottomRow() - Method in class UDPiece
 
getDirection() - Method in class PieceMove
Return the Direction Piece is to be moved.
getLeftCol() - Method in class Piece
Return the leftmost column of the piece.
getLegalMoves() - Method in class RailroadRushHour
Return a list of legal moves for the current puzzle state.
getPiece() - Method in class PieceMove
Return the Piece to be moved.
getRightCol() - Method in class LRPiece
 
getRightCol() - Method in class LRUDPiece
 
getRightCol() - Method in class Piece
Return the column of the piece's bottom right corner.
getRightCol() - Method in class UDPiece
 
getTopRow() - Method in class Piece
Return the top row of the piece.

I

isSolved() - Method in class RailroadRushHour
Return whether or not this puzzle is solved.

J

junior1() - Static method in class RailroadRushHour
Return the first junior Railroad Rush Hour puzzle.
junior10() - Static method in class RailroadRushHour
Return the last junior Railroad Rush Hour puzzle.

L

leftCol - Variable in class Piece
piece leftmost column
LRPiece - Class in <Unnamed>
LRPiece - An abstract class for a Railroad Rush Hour puzzle piece that can move left and right.
LRPiece(char[][], char, int, int, int) - Constructor for class LRPiece
Call the superclass (Piece) constructor with the same parameters.
LRUDPiece - Class in <Unnamed>
LRUDPiece - An abstract class for a Railroad Rush Hour puzzle piece that can move in all directions.
LRUDPiece(char[][], char, int, int, int) - Constructor for class LRUDPiece
Call the superclass (Piece) constructor with the same parameters.

M

main(String[]) - Static method in class RandomRailroadRushHour
Test the random walk solver for various Railroad Rush Hour puzzles.

P

Piece - Class in <Unnamed>
Piece - An abstract class for a Railroad Rush Hour puzzle piece
Piece(char[][], char, int, int, int) - Constructor for class Piece
 
PieceMove - Class in <Unnamed>
 
PieceMove(Piece, Direction) - Constructor for class PieceMove
Construct a PieceMove with a given Piece and the Direction it is to be moved.

R

RailroadRushHour - Class in <Unnamed>
RailroadRushHour - a model for the Railroad Rush Hour puzzle (http://www.puzzles.com/puzzlesineducation/plans/rushhourguide.pdf ; http://en.wikipedia.org/wiki/Rush_Hour_(board_game) ; ) To use, one creates a RailroadRushHour object and then adds Piece objects via the object's addPiece(Piece) method.
RailroadRushHour(int, int) - Constructor for class RailroadRushHour
Create an empty board, ready for piece addition via addPiece(Piece).
random - Static variable in class RandomRailroadRushHour
random number generator
RandomRailroadRushHour - Class in <Unnamed>
RandomRailroadRushHour - a random solver for the Railroad Rush Hour puzzle (http://www.puzzles.com/puzzlesineducation/plans/rushhourguide.pdf ; http://en.wikipedia.org/wiki/Rush_Hour_(board_game) ; ) To use, one creates a RandomRailroadRushHour object and then adds Piece objects via the object's pieces.add(Piece) method.
RandomRailroadRushHour() - Constructor for class RandomRailroadRushHour
 
randomWalkSolve(RailroadRushHour) - Static method in class RandomRailroadRushHour
Attempt to solve the current puzzle via random walk, that is, trying random piece moves until a goal state is reached.

S

size - Variable in class Piece
piece dimension
SIZE - Static variable in class RailroadRushHour
number of interior grid squares on a side

T

topRow - Variable in class Piece
piece topmost row
toString() - Method in enum Direction
Return a String with the single character representation of this direction.
toString() - Method in class Piece
Return a String with the single display character for the piece.
toString() - Method in class PieceMove
Return the String concatenation of the representations for a piece and a direction.
toString() - Method in class RailroadRushHour
Return the String representation of the current puzzle state as a grid of characters that are either (1) the character of the piece occupying the grid cell, or (2) a '+' if the grid cell is empty.
tryMove(Direction) - Method in class Piece
Attempt a piece movement in a given direction, returning true or false depending on whether or not the move was successful.
tryMove() - Method in class PieceMove
Tries to make the given move.
tryMove(String) - Method in class RailroadRushHour
Given a move description (a length 2 String with a piece character followed by a direction character), attempt to make the move, and return whether or not it was legal and successful.

U

UDPiece - Class in <Unnamed>
UDPiece - An abstract class for a Railroad Rush Hour puzzle piece that can move up and down.
UDPiece(char[][], char, int, int, int) - Constructor for class UDPiece
Call the superclass (Piece) constructor with the same parameters.

V

valueOf(String) - Static method in enum Direction
Returns the enum constant of this type with the specified name.
values() - Static method in enum Direction
Returns an array containing the constants of this enum type, in the order they are declared.
A B C D E G I J L M P R S T U V 
Skip navigation links