--- a/src/chess/queen.c Sun Aug 02 15:19:47 2026 +0200 +++ b/src/chess/queen.c Thu Aug 06 14:45:55 2026 +0200 @@ -43,3 +43,38 @@ return bishop_isblocked(gamestate, move); } } + +size_t queen_moves(GameState *gamestate, Color c, Row r, File f, Move *moves) { + size_t count = 0; + const int directions[8][2] = { + { 1, 0}, + {-1, 0}, + { 0, 1}, + { 0, -1}, + { 1, 1}, + { 1, -1}, + {-1, 1}, + {-1, -1} + }; + + for (size_t i = 0 ; i < 8 ; i++) { + int row = r + directions[i][0]; + int file = f + directions[i][1]; + + while (isidx(row) && isidx(file)) { + moves[count] = (Move){0}; + moves[count].piece = mkpiece(QUEEN, c); + moves[count].fromrow = r; + moves[count].fromfile = f; + moves[count].torow = row; + moves[count].tofile = file; + moves[count].capture = piece_at(gamestate, row, file) != 0; + count++; + + row += directions[i][0]; + file += directions[i][1]; + } + } + + return count; +}