Index of values


A
apply [Solver.PUZZLE]
apply s m the state created by executing the move m in state s

B
build_tree [Huffman]
given a list of characters, build an optimal Huffman tree for encoding that list.

C
choice [Util]
randomly select an element from a list
comparator [PQueue.PQ]
comparator q returns the comparator that q is ordered by

D
decode [Huffman]
decode tree bits decodes bits using the encoding scheme specified for the encode function.

E
empty [PQueue.PQ]
constructs an empty priority queue, ordered by the given comparator
encode [Huffman]
encode tree chars produces the bit list representing chars using the Huffman tree tree.
equal [Solver.PUZZLE]
returns true if two states are equal

G
goal [CubePuzzle]
the solved cube
goodness [Solver.PUZZLE]
Compares two states based on how close to the goal they are.

I
init [Animation.PUZZLE]
initialize a new window for drawing on
insert [PQueue.PQ]
insert x q yields a queue containing x and the elements of q
is_empty [PQueue.PQ]
is_empty q returns true if q is empty
is_goal [Solver.PUZZLE]
returns true if the given state is a goal state

M
max [PQueue.PQ]
max q returns the maximum element of q (according to comparator q) returns None if the queue is empty.
moves [Solver.PUZZLE]
Gives the list of all possible moves from a given state

O
of_list [TilePuzzle]
Given a size n and a list l of size (n*n), creates a sliding tile puzzle.

R
rand_list [Util]
rand_list n l returns a random list of l integers between 0 and n
remove [PQueue.PQ]
remove q returns the maximum element of q (according to comparator q) and another queue q' containing the remaining elements
render [Animation.PUZZLE]
render astate state (Some(percent, move)) draws the given state of the puzzle on the window defined by astate, with move partially applied.
run [Animation.Make]
Given an initial state s and a list of moves, loop an animation of the application of those moves to the initial state.

S
shuffle [Util]
randomly shuffle a list.
size [PQueue.PQ]
size q returns the number of elements of q
solve [Solver.S]
Given an initial state s, output a sequence [m1; m2; ...] that when applied to s in order, produces a goal state.
sort [PQueue.Heapsort]
see List.sort
string_of_list [Util]
string_of_list f l returns a pretty joining of f invoked on every element of l.

T
time [Util]
time f x runs f x and returns the time it takes to run (in seconds).