This section is for generally useful subroutines and data structures which may be used by many independent sections of the program.
Data Structures
- p_table: a general parameterized table
Procedures
- piece_unparse = proc(pc: pieceColor, pk: pieceKind) returns(string)
- effects: Returns the string corresponding to a piece of the given
kind and color, as described by the format on
pages 9-10 of the problem set.
- piece_parse = proc(s:string) returns(pieceColor, pieceKind)
signals(not_a_piece)
- effects: Given a string in the format on pages 9-10 of the
problem set, returns the corresponding pieceColor and
pieceKind. Signals not_a_piece if s is in the wrong format.
- move_unparse = proc(m: moveData) returns(string)
- effects: returns a string representing the move m in the format
given by section 3.3.1 of the problem set handout
- move_parse = proc(s: string) returns(moveData)
signals(bad_format)
- effects: returns the move represented by the string s, which is
expected to be in the format given by section 3.3.1 of
the problem set handout (signals bad_format otherwise).