I looked at the xboard code a little. I'm amazed by the effort to achieve great generality to support multiple variants. GenPseudoLegal() is 450 lines of code, 90% of which is not related to standard chess.
If you know that board height is equal to board width and both are equal to 8 and all playable pieces are on board (I love crazyhouse!) it is probably easier to make your board look great in any resolution.
Preprocessor trick inside backend.c are worthy of some special obfuscation award:
Code: Select all
ChessSquare FIDEArray[2][BOARD_FILES] = {
{ WhiteRook, WhiteKnight, WhiteBishop, WhiteQueen,
WhiteKing, WhiteBishop, WhiteKnight, WhiteRook },
{ BlackRook, BlackKnight, BlackBishop, BlackQueen,
BlackKing, BlackBishop, BlackKnight, BlackRook }
};
....
....
....
#if (BOARD_FILES>=10)
ChessSquare CapablancaArray[2][BOARD_FILES] = {
{ WhiteRook, WhiteKnight, WhiteAngel, WhiteBishop, WhiteQueen,
WhiteKing, WhiteBishop, WhiteMarshall, WhiteKnight, WhiteRook },
{ BlackRook, BlackKnight, BlackAngel, BlackBishop, BlackQueen,
BlackKing, BlackBishop, BlackMarshall, BlackKnight, BlackRook }
};
....
....
....
#else // !(BOARD_FILES>=10)
#define XiangqiPosition FIDEArray
#define CapablancaArray FIDEArray
With HGM's modifications xboard supports 30 chess variants, and engines for variants

, and variant play on server(!). If you want with reasonable effort you can add your own variant with 3-way castle.
The original code was written with different functional requirements so long ago... I'm not experienced in developing but supporting Chinese chess and standard chess in the same program with the same code looks a bit extreme.
