src/chess/queen.c

changeset 194
619f07c95894
parent 170
bde99d803caf
child 195
27d02ccb0cef
--- a/src/chess/queen.c	Tue Aug 25 18:35:18 2026 +0200
+++ b/src/chess/queen.c	Tue Aug 25 18:59:18 2026 +0200
@@ -45,7 +45,7 @@
 }
 
 size_t queen_moves(const GameState *gamestate,
-        Color c, Row r, File f, Move *moves) {
+        Color c, Rank r, File f, Move *moves) {
 
     size_t count = 0;
     const int directions[8][2] = {
@@ -60,20 +60,20 @@
     };
 
     for (size_t i = 0 ; i < 8 ; i++) {
-        int row = r + directions[i][0];
-        int file = f + directions[i][1];
+        Rank rank = r + directions[i][0];
+        File file = f + directions[i][1];
 
-        while (isidx(row) && isidx(file)) {
+        while (isidx(rank) && isidx(file)) {
             moves[count] = (Move){0};
             moves[count].piece = mkpiece(QUEEN, c);
-            moves[count].fromrow = r;
+            moves[count].fromrank = r;
             moves[count].fromfile = f;
-            moves[count].torow = row;
+            moves[count].torank = rank;
             moves[count].tofile = file;
-            moves[count].capture = piece_at(gamestate, row, file) != 0;
+            moves[count].capture = piece_at(gamestate, rank, file) != 0;
             count++;
 
-            row += directions[i][0];
+            rank += directions[i][0];
             file += directions[i][1];
         }
     }

mercurial