add OnlyFENs output option for the current board state - chess-puzzles - chess … | |
git clone git://git.codemadness.org/chess-puzzles | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 30a2ab3dd2979115341beaedc6d4a4918541036a | |
parent 0bf730b426ada19f487f1791faf13269989abc04 | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Wed, 20 Dec 2023 18:50:33 +0100 | |
add OnlyFENs output option for the current board state | |
Maybe I'll use this for automatic testing later | |
Diffstat: | |
M Makefile | 3 ++- | |
M fen_to_svg.c | 10 ++++++++++ | |
2 files changed, 12 insertions(+), 1 deletion(-) | |
--- | |
diff --git a/Makefile b/Makefile | |
@@ -2,6 +2,7 @@ build: clean | |
${CC} -o fen_to_svg fen_to_svg.c ${CFLAGS} ${LDFLAGS} | |
ln -s fen_to_svg fen_to_ascii | |
ln -s fen_to_svg fen_to_tty | |
+ ln -s fen_to_svg fen_to_fen | |
db: | |
rm -f lichess_db_puzzle.csv.zst lichess_db_puzzle.csv | |
@@ -9,4 +10,4 @@ db: | |
zstd -d < lichess_db_puzzle.csv.zst > lichess_db_puzzle.csv | |
clean: | |
- rm -f fen_to_svg fen_to_ascii fen_to_tty | |
+ rm -f fen_to_ascii fen_to_fen fen_to_svg fen_to_tty | |
diff --git a/fen_to_svg.c b/fen_to_svg.c | |
@@ -345,6 +345,14 @@ ascii_showpiece(int c) | |
putchar(c); | |
} | |
+/* OnlyFENs */ | |
+void | |
+fen_showboard(void) | |
+{ | |
+ showboardfen(); | |
+ printf("\n"); | |
+} | |
+ | |
/* show board */ | |
/* TODO: show fancier, unicode and background square color */ | |
/* TODO: use the output format similar to stockfish "d" command */ | |
@@ -590,6 +598,8 @@ main(int argc, char *argv[]) | |
ascii_showboard(); | |
else if (!strcmp(progname, "fen_to_tty")) | |
tty_showboard(); | |
+ else if (!strcmp(progname, "fen_to_fen")) | |
+ fen_showboard(); | |
else | |
svg_showboard(); | |