Introduction
Introduction Statistics Contact Development Disclaimer Help
fix notating files and rank for piece moves - chess-puzzles - chess puzzle book…
git clone git://git.codemadness.org/chess-puzzles
Log
Files
Refs
README
LICENSE
---
commit 887918beab1aba026f2c228bb8ef770d420d338e
parent 32c2e6a2c44fba3b0242123894dcacf79f59578f
Author: Hiltjo Posthuma <[email protected]>
Date: Tue, 11 Jun 2024 15:42:26 +0200
fix notating files and rank for piece moves
Do not notate files and ranks for pawn moves (requires only file).
Do not allow to output the same file twice.
Diffstat:
M fen.c | 31 ++++++++++++++---------------…
1 file changed, 14 insertions(+), 17 deletions(-)
---
diff --git a/fen.c b/fen.c
@@ -1302,27 +1302,24 @@ board_playmoves(struct board *b, const char *moves)
}
/* pawn move needs no notation */
- if (piece != 'p' && piece != 'P')
+ if (piece != 'p' && piece != 'P') {
pgn("%c", pgnpiece(piece));
- /* check ambiguity for certain pieces and make…
- countambigousmoves(b, side, piece, x, y, x2, y…
- &countfile, &countrank, &countboard);
+ /* check ambiguity for certain pieces …
+ countambigousmoves(b, side, piece, x, …
+ &countfile, &countrank, &count…
- if (countfile > 1) {
- pgn("%c", xtofile(x));
- speak("%c", xtofile(x));
- }
- if (countrank > 1) {
- pgn("%c", ytorank(y));
- speak("%c", ytorank(y));
- }
- if (countboard > 1) {
- pgn("%c", xtofile(x));
- speak("%c", xtofile(x));
+ if (countfile > 1 || countboard > 1) {
+ pgn("%c", xtofile(x));
+ speak("%c", xtofile(x));
+ }
+ if (countrank > 1) {
+ pgn("%c", ytorank(y));
+ speak("%c", ytorank(y));
+ }
+ if (countfile > 1 || countrank > 1 || …
+ speak(" ");
}
- if (countfile > 1 || countrank > 1 || countboa…
- speak(" ");
if (tookpiece) {
/* pawn captures are prefixed by the f…
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.