diff -r 663676cfef6e -r 9962f5d98764 src/chess/bishop.c --- a/src/chess/bishop.c Sun Aug 02 15:19:47 2026 +0200 +++ b/src/chess/bishop.c Thu Aug 06 14:45:55 2026 +0200 @@ -52,3 +52,35 @@ return false; } + +size_t bishop_moves(GameState *gamestate, Color c, Row r, File f, Move *moves) { + + size_t count = 0; + const int directions[4][2] = { + { 1, 1}, + { 1, -1}, + {-1, 1}, + {-1, -1} + }; + + for (size_t i = 0 ; i < 4 ; 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(BISHOP, 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; +}