From 325e847b0de4642f9f4de62c379f310f72142c77 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 5 May 2024 03:08:19 +0200 Subject: Keep the old function --- FICS/algcheck.c | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/FICS/algcheck.c b/FICS/algcheck.c index 1b1663b..b92a64c 100644 --- a/FICS/algcheck.c +++ b/FICS/algcheck.c @@ -300,24 +300,31 @@ PUBLIC int alg_parse_move(char *mstr, game_state_t * gs, move_t * mt) return MOVE_OK; } -/* A assumes the move has yet to be made on the board */ -/* this is the old stupid function, we are testing one from soso... -PUBLIC char *alg_unparse( game_state_t *gs, move_t *mt ) +/* + * A assumes the move has yet to be made on the board. (This is the + * old stupid function, we are testing one from soso...) + */ +#if 0 +PUBLIC char * +alg_unparse(game_state_t *gs, move_t *mt) { - static char mStr[20]; - - if ((piecetype(gs->board[mt->fromFile][mt->fromRank]) == KING) && - ((mt->fromFile == 4) && (mt->toFile == 6)) ) - return "o-o"; - if ((piecetype(gs->board[mt->fromFile][mt->fromRank]) == KING) && - ((mt->fromFile == 4) && (mt->toFile == 2)) ) - return "o-o-o"; - - sprintf( mStr, "%c%d%c%d", mt->fromFile+'a', mt->fromRank+1, - mt->toFile+'a', mt->toRank+1 ); - return mStr; + static char mStr[20] = { '\0' }; + + if ((piecetype(gs->board[mt->fromFile][mt->fromRank]) == KING) && + ((mt->fromFile == 4) && (mt->toFile == 6))) + return "o-o"; + if ((piecetype(gs->board[mt->fromFile][mt->fromRank]) == KING) && + ((mt->fromFile == 4) && (mt->toFile == 2))) + return "o-o-o"; + + msnprintf(mStr, sizeof mStr, "%c%d%c%d", + mt->fromFile + 'a', + mt->fromRank + 1, + mt->toFile + 'a', + mt->toRank + 1); + return mStr; } -*/ +#endif /* * Soso: Rewrote the alg_unparse() function. -- cgit v1.2.3