DESCRIPTION

This class implements the input_board method, which enables to read boards in "key = value" format. Several types of values are supported.

$self->input_board($file_spec, $spec);

This method accepts two arguments. $file_spec which is the filename, reference to a filehandle, or reference to the text containing the board specification.

$spec is a specification of the board given as a reference to a hash. The keys are the keys inside the file. The values are references to hashes containing parameters. The 'required' parameter is given to specify that an exception should be thrown if this key was not specified. The other parameter (a mandatory one) is type which specified the type of the value. Available types are:

integer

A simple integer (will be returned as a scalar)

xy(integer)

An (X,Y) pair. Will be returned as { 'x' => $x, 'y' => $y }.

array(xy(integer))

An array of [(X1,Y1),(X2,Y2),(X3,Y3)...] pairs. Will be returned as a reference to an array of (X,Y) pairs.

array(start_end(xy(integer)))

An array of [((SX1,SX2)->(EX1,EX2)), ((SX1,SX2)->(EX1,EX2))...] pairs of (X,Y) pairs. Will be returned as a reference to an array of