commit - 81af718d088960760653fcf4cb3ea7373cc38ceb
commit + a25442746dbd79b32a1eaedc59e216696a22731d
blob - 45357b2957e969ec77c13b85376960257cbfa44b
blob + f6e33be7fba4aac32486350ed974f610c262a748
--- FICS/gameproc.c
+++ FICS/gameproc.c
return COM_OK;
}
-PRIVATE int player_has_mating_material(game_state_t *gs, int color)
+PRIVATE int
+player_has_mating_material(game_state_t *gs, int color)
{
- int i, j;
- int piece;
- int minor_pieces = 0;
+ int i, j;
+ int minor_pieces = 0;
+ int piece;
- for (i = 0; i < 8; i++)
- for (j = 0; j < 8; j++) {
- piece = gs->board[i][j];
- switch (piecetype(piece)) {
- case BISHOP:
- case KNIGHT:
- if (iscolor(piece, color))
- minor_pieces++;
- break;
- case KING:
- case NOPIECE:
- break;
- default:
- if (iscolor(piece, color))
- return 1;
- }
- }
- return ((minor_pieces > 1) ? 1 : 0);
+ for (i = 0; i < 8; i++) {
+ for (j = 0; j < 8; j++) {
+ piece = gs->board[i][j];
+
+ switch (piecetype(piece)) {
+ case BISHOP:
+ case KNIGHT:
+ if (iscolor(piece, color))
+ minor_pieces++;
+ break;
+ case KING:
+ case NOPIECE:
+ break;
+ default:
+ if (iscolor(piece, color))
+ return 1;
+ }
+ }
+ }
+
+ return (minor_pieces > 1 ? 1 : 0);
}
PUBLIC int