diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-05-04 12:58:09 +0200 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-05-04 12:58:09 +0200 |
commit | d1a9e9edaa8c2af0d14e2c5debbcecc6124ad2a6 (patch) | |
tree | a7d9065ca03fdfe505cdb642ff8c863c54319005 /FICS | |
parent | 5568dbb33da1edfc836de8dc370ee5c7986275e7 (diff) |
Reformatted WriteGameState()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/gamedb.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c index 23891d4..81866e9 100644 --- a/FICS/gamedb.c +++ b/FICS/gamedb.c @@ -755,20 +755,27 @@ PRIVATE int ReadMove(FILE * fp, move_t *m) return 0; } -PRIVATE void WriteGameState(FILE * fp, game_state_t *gs) +PRIVATE void +WriteGameState(FILE *fp, game_state_t *gs) { - int i, j; + int i, j; - for (i = 0; i < 8; i++) - for (j = 0; j < 8; j++) { - fprintf(fp, "%c", PieceToChar(gs->board[i][j])); - } - fprintf(fp, "%d %d %d %d %d %d", - gs->wkmoved, gs->wqrmoved, gs->wkrmoved, - gs->bkmoved, gs->bqrmoved, gs->bkrmoved); - for (i = 0; i < 8; i++) - fprintf(fp, " %d %d", gs->ep_possible[0][i], gs->ep_possible[1][i]); - fprintf(fp, " %d %d %d\n", gs->lastIrreversable, gs->onMove, gs->moveNum); + for (i = 0; i < 8; i++) { + for (j = 0; j < 8; j++) + fprintf(fp, "%c", PieceToChar(gs->board[i][j])); + } + + fprintf(fp, "%d %d %d %d %d %d", + gs->wkmoved, gs->wqrmoved, gs->wkrmoved, + gs->bkmoved, gs->bqrmoved, gs->bkrmoved); + + for (i = 0; i < 8; i++) { + fprintf(fp, " %d %d", gs->ep_possible[0][i], + gs->ep_possible[1][i]); + } + + fprintf(fp, " %d %d %d\n", gs->lastIrreversable, gs->onMove, + gs->moveNum); } PRIVATE int |