aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/algcheck.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-05 03:08:19 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-05 03:08:19 +0200
commit325e847b0de4642f9f4de62c379f310f72142c77 (patch)
tree86447844e9f4fe57a6af30c130bda854db519177 /FICS/algcheck.c
parent910bf9fe14acd5f24dfac029c3bb74e1fff80c17 (diff)
Keep the old function
Diffstat (limited to 'FICS/algcheck.c')
-rw-r--r--FICS/algcheck.c39
1 files 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.