unserializable / monchester

Monchester, chess engine for CECP interfaces and console
GNU General Public License v3.0
4 stars 1 forks source link

More FEN validation for lenient CECP interfaces #2

Closed unserializable closed 3 years ago

unserializable commented 3 years ago

From: https://www.gnu.org/software/xboard/engine-intf.html

Illegal positions: Note that either setboard or edit can be used to send an illegal position to the engine. The user can create any position with xboard's Edit Position command (even, say, an empty board, or a board with 64 white kings and no black ones). If your engine receives a position that it considers illegal, I suggest that you send the response "tellusererror Illegal position", and then respond to any attempted move with "Illegal move" until the next new, edit, or setboard command.

Variant capable interfaces like XBoard are quite lenient on what they allow on the board. Engine however should not process such positions. Besides lack of both kings, one thing that would definitely prevent normal engine play would be the presence of pawns on either 1st or 8th rank, so reject such positions too.

Couple of FENS that will be considered illegal, with pawn on 1st / 8th rank:

unserializable commented 3 years ago

Done in commit 7aa9d6a8c4b2097c9cbaa8bb8469409ead775f45