Skip navigation links
C D E G I L M O P R S T U W Y 

C

clear() - Method in class TwoBitRandomAccessFile
Set all two-bit file positions to value 0.
close() - Method in class TwoBitRandomAccessFile
Close the two-bit random access file.
COLS - Static variable in class TrafficLightsSolver
 

D

DoubleFileConverter - Class in <Unnamed>
 
DoubleFileConverter() - Constructor for class DoubleFileConverter
 

E

eval(int[]) - Method in class TrafficLightsSolver
Given a game state, recursively evaluate the value of that state and all states reachable from it given optimal play, assigning it the value WIN or LOSS.

G

get(long) - Method in class TwoBitRandomAccessFile
Get and return the unsigned two-bit value at the given two-bit file position.
GREEN - Static variable in class TrafficLightsSolver
 

I

isGameOver(int[]) - Method in class TrafficLightsSolver
Return whether or not the game is over (3 GREEN/YELLOW/RED in a row horizontally, vertically, or diagonally).

L

lines - Static variable in class TrafficLightsSolver
 
LOSS - Static variable in class TrafficLightsSolver
 

M

main(String[]) - Static method in class TrafficLightsSolver
Test code that solves the game and then allows users to play the game with solution information.

O

OFF - Static variable in class TrafficLightsSolver
 

P

play() - Method in class TrafficLightsSolver
Play a text-based Traffic Lights game, displaying winning/losing state information as the game progresses.

R

readBinaryFile(String) - Static method in class DoubleFileConverter
Read doubles from a binary file of a given name, one double at a time, and return an ArrayList<Double> of those doubles.
readBinaryListFile(String) - Static method in class DoubleFileConverter
Read an an ArrayList<Double> from a binary file of a given name and return it.
readTextFile(String) - Static method in class DoubleFileConverter
Read doubles from a text file of a given name, one double per line, and return an ArrayList<Double> of those doubles.
RED - Static variable in class TrafficLightsSolver
 
ROWS - Static variable in class TrafficLightsSolver
 

S

set(long, int) - Method in class TwoBitRandomAccessFile
Set the given two-bit file position to the given unsigned two-bit value.
solve() - Method in class TrafficLightsSolver
Starting with the initial game state, recursively evaluate the value of each state given optimal play, assigning each reachable game state to WIN or LOSS.
stateToInt(int[]) - Static method in class TrafficLightsSolver
Convert the state to a unique integer by treating positions a base 4 digits.
stateToString(int[]) - Static method in class TrafficLightsSolver
Return a String representation of the given game state.

T

TrafficLightsSolver - Class in <Unnamed>
 
TrafficLightsSolver(String) - Constructor for class TrafficLightsSolver
Create a TwoBitRandomAccessFile large enough to access any Traffic Lights game state (reachable or not).
TwoBitRandomAccessFile - Class in <Unnamed>
 
TwoBitRandomAccessFile(File) - Constructor for class TwoBitRandomAccessFile
Opens the given File as a read/write RandomAccessFile
TwoBitRandomAccessFile(String) - Constructor for class TwoBitRandomAccessFile
Opens the File of the given filename as a read/write RandomAccessFile
TwoBitRandomAccessFile(File, int) - Constructor for class TwoBitRandomAccessFile
Opens the given File as a read/write RandomAccessFile with a capacity for the given number of two-bit data items.
TwoBitRandomAccessFile(String, int) - Constructor for class TwoBitRandomAccessFile
Opens the File of the given filename as a read/write RandomAccessFile with a capacity for the given number of two-bit data items.

U

UNKNOWN - Static variable in class TrafficLightsSolver
 

W

WIN - Static variable in class TrafficLightsSolver
 
writeBinaryFile(String, ArrayList<Double>) - Static method in class DoubleFileConverter
Write given doubles to a binary file of a given name, one double at a time.
writeBinaryListFile(String, ArrayList<Double>) - Static method in class DoubleFileConverter
Write a given ArrayList<Double> to a binary file of a given name.
writeTextFile(String, ArrayList<Double>) - Static method in class DoubleFileConverter
Write given doubles to a text file of a given name, one double per line.

Y

YELLOW - Static variable in class TrafficLightsSolver
 
C D E G I L M O P R S T U W Y 
Skip navigation links