King moves from a central file to the king-side-castled position (1
square away from the right corner) were intercepted and printed as O-O
in CoordsToAlgebraic. But on a 5x5 board (mini-Shogi!) this caught the
normal King move Kc1-d1 as well. The castling notation is now reserved
for King moves larger than one step.
/* Use style "O-O" (oh-oh) for PGN compatibility */
else if (rf == rt &&
rf == ((piece == WhiteKing) ? 0 : BOARD_HEIGHT-1) &&
+ (ft - ff > 1 || ff - ft > 1) && // No castling if legal King move (on narrow boards!)
((ff == BOARD_WIDTH>>1 && (ft == BOARD_LEFT+2 || ft == BOARD_RGHT-2)) ||
(ff == (BOARD_WIDTH-1)>>1 && (ft == BOARD_LEFT+1 || ft == BOARD_RGHT-3)))) {
if(ft==BOARD_LEFT+1 || ft==BOARD_RGHT-2)