aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/movecheck.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-03-17 19:59:06 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-03-17 19:59:06 +0100
commiteaa944ffaa5d4c5397aecc109fbf5a263805f0a1 (patch)
tree8beb19447956db81bad81b87f40632d1fca472b5 /FICS/movecheck.c
parent6968093d6d4b72e8cc99ab4dce34321df6d98f7e (diff)
Reformatted functions
Diffstat (limited to 'FICS/movecheck.c')
-rw-r--r--FICS/movecheck.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/FICS/movecheck.c b/FICS/movecheck.c
index 5228495..bfce3c8 100644
--- a/FICS/movecheck.c
+++ b/FICS/movecheck.c
@@ -269,26 +269,26 @@ PRIVATE int legal_rook_move(game_state_t * gs, int ff, int fr, int tf, int tr)
}
}
-PRIVATE int legal_queen_move(game_state_t * gs, int ff, int fr, int tf, int tr)
+PRIVATE int
+legal_queen_move(game_state_t *gs, int ff, int fr, int tf, int tr)
{
- return legal_rook_move(gs, ff, fr, tf, tr) || legal_bishop_move(gs, ff, fr, tf, tr);
+ return (legal_rook_move(gs, ff, fr, tf, tr) ||
+ legal_bishop_move(gs, ff, fr, tf, tr));
}
-/* Ckeck, if square (kf,kr) is attacked by enemy piece.
- * Used in castling from/through check testing.
- */
-
-/* new one from soso: */
-PRIVATE int is_square_attacked (game_state_t *gs, int kf, int kr)
+PRIVATE int
+is_square_attacked(game_state_t *gs, int kf, int kr)
{
- game_state_t fakeMove;
-
- fakeMove = *gs;
- fakeMove.board[4][kr] = NOPIECE;
- fakeMove.board[kf][kr] = KING | fakeMove.onMove;
- fakeMove.onMove = CToggle (fakeMove.onMove);
- if (in_check(&fakeMove)) return 1;
- else return 0;
+ game_state_t fakeMove;
+
+ fakeMove = *gs;
+ fakeMove.board[4][kr] = NOPIECE;
+ fakeMove.board[kf][kr] = (KING | fakeMove.onMove);
+ fakeMove.onMove = CToggle(fakeMove.onMove);
+
+ if (in_check(&fakeMove))
+ return 1;
+ return 0;
}
PRIVATE int