src/chess/rook.c

changeset 80
b980a7192b5a
parent 55
54ea19938d57
--- a/src/chess/rook.c	Tue Jun 03 08:43:17 2025 +0200
+++ b/src/chess/rook.c	Wed Jun 04 23:56:40 2025 +0200
@@ -30,11 +30,11 @@
 #include "rules.h"
 #include "rook.h"
 
-_Bool rook_chkrules(Move *move) {
+bool rook_chkrules(Move *move) {
     return move->torow == move->fromrow || move->tofile == move->fromfile;
 }
 
-_Bool rook_isblocked(GameState *gamestate, Move *move) {
+bool rook_isblocked(GameState *gamestate, Move *move) {
     
     if (move->torow == move->fromrow) {
         int d = move->tofile > move->fromfile ? 1 : -1;
@@ -42,7 +42,7 @@
         while (f != move->tofile-d) {
             f += d;
             if (gamestate->board[move->fromrow][f]) {
-                return 1;
+                return true;
             }
         }
     } else {
@@ -51,10 +51,10 @@
         while (r != move->torow - d) {
             r += d;
             if (gamestate->board[r][move->fromfile]) {
-                return 1;
+                return true;
             }
         }
     }
     
-    return 0;
+    return false;
 }

mercurial