Error Constants This class contains a few public methods that are the only thing most users of the package will ever need. Protected methods are available for usage by child classes, and it is expected that all child classes will implement certain protected methods used by the utility methods in this class.
Public API methods used are:
resetGame(): in order to start a new game (pass a FEN for a starting
Determine the presence of a basic draw as defined by FIDE rules
The rule states:
The game is drawn when one of the following endings arises:
(a) king against king;
(b) king against king with only bishop or knight;
(c) king and bishop against king and bishop, with both bishops
on diagonals of the same colour.
The game is drawn, upon a claim by the player having the move, when the
same position, for the third time:
(a) is about to appear, if he first writes the move on his
scoresheet and declares to the arbiter his intention of making
this move; or
(b) has just appeared, the same player having the move each time.
The position is considered the same if pieces of the same kind and
colour occupy the same squares, and if all the possible moves of
all the pieces are the same, including the rights to castle [at
some future time] or to capture a pawn "en passant".
This class determines draw by comparing FENs rendered after every move
Get all the squares a knight could move to on an empty board
WARNING: assumes valid input
Return: Returns an array of all the squares organized by compass point, that a knight can go to. These squares may be indexed by any of WNW, NNW, NNE, ENE, ESE, SSE, SSW or WSW, unless $returnFlatArray is true, in which case an array of squares is returned