fen.c: fix castling for chess960 - chess-puzzles - chess puzzle book generator
(HTM) git clone git://git.codemadness.org/chess-puzzles
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 551d1075b050556fafd5ff8c86e0b3a92bbbda46
(DIR) parent bf941d069fdc94c7157de62e737e9f305a751b5b
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 27 Jan 2024 21:00:45 +0100
fen.c: fix castling for chess960
Diffstat:
M fen.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/fen.c b/fen.c
@@ -1183,8 +1183,8 @@ board_playmoves(struct board *b, const char *moves)
if (getpiece(b, i, y2) == rookpiece) {
place(b, 0, x, y); /* clear previous square */
place(b, 0, i, y2); /* clear rook square */
- place(b, rookpiece, x2 - 1, y2); /* rook next to king */
- place(b, piece, x2, y2); /* place king */
+ place(b, rookpiece, 5, y2); /* rook next to king */
+ place(b, piece, 6, y2); /* place king */
x2 = i; /* update square for highlight */
break;
}
@@ -1196,8 +1196,8 @@ board_playmoves(struct board *b, const char *moves)
if (getpiece(b, i, y2) == rookpiece) {
place(b, 0, x, y); /* clear previous square */
place(b, 0, i, y2); /* clear rook square */
- place(b, rookpiece, x2 + 1, y2); /* rook next to king */
- place(b, piece, x2, y2); /* place king */
+ place(b, rookpiece, 3, y2); /* rook next to king */
+ place(b, piece, 2, y2); /* place king */
x2 = i; /* update square for highlight */
break;
}