From 6a58819ef7a27bd8b019f0519a066fef04066293 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 5 May 2024 18:09:41 +0200 Subject: Reformatted legal_knight_move() --- FICS/movecheck.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/FICS/movecheck.c b/FICS/movecheck.c index 99e5185..d7cf963 100644 --- a/FICS/movecheck.c +++ b/FICS/movecheck.c @@ -175,21 +175,23 @@ PRIVATE int legal_pawn_move( game_state_t *gs, int ff, int fr, int tf, int tr ) return 0; } -PRIVATE int legal_knight_move(game_state_t * gs, int ff, int fr, int tf, int tr) +PRIVATE int +legal_knight_move(game_state_t *gs, int ff, int fr, int tf, int tr) { - int dx, dy; + int dx, dy; - dx = ff - tf; - dy = fr - tr; - if ((dx == 2) || (dx == -2)) { - if ((dy == -1) || (dy == 1)) - return 1; - } - if ((dy == 2) || (dy == -2)) { - if ((dx == -1) || (dx == 1)) - return 1; - } - return 0; + dx = ff - tf; + dy = fr - tr; + + if ((dx == 2) || (dx == -2)) { + if ((dy == -1) || (dy == 1)) + return 1; + } + if ((dy == 2) || (dy == -2)) { + if ((dx == -1) || (dx == 1)) + return 1; + } + return 0; } PRIVATE int -- cgit v1.2.3