diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-13 21:58:18 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2026-07-13 21:58:18 +0530 |
| commit | f8c0dc54e36cc201c657aa12e5a22029b092e1bc (patch) | |
| tree | a0dd1a42c9681be98a7508c128db0dacacefc2e7 /include/engine/moves.h | |
| parent | 2e8b78ab0ef01eaacd8094ff839ac93b4451e9c3 (diff) | |
restructed all the files + uci done now
also broke the symbol analyser in the process, i didn't help much, i had
to pull out the pen & paper, but it made a cool graph never the less
multithreading was a pain! but it got it in the end
fixed the structs naming convention, if it's used outside by other
files, it's typedeffed, otherwise it's not
fixed the recursive imports issued i had in go_args*, where i was
casting it to void* in uci to make it work
now response.c doesn't deal with ipc, really happy with that change
now every single thing has its own responsibility
Diffstat (limited to 'include/engine/moves.h')
| -rw-r--r-- | include/engine/moves.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/include/engine/moves.h b/include/engine/moves.h index 86c4844..4032557 100644 --- a/include/engine/moves.h +++ b/include/engine/moves.h @@ -1,8 +1,8 @@ #ifndef MOVES_H #define MOVES_H -#include "../ints.h" -#include "../bitboard.h" +#include "ints.h" +#include "bitboard.h" typedef u8 square_t; @@ -10,9 +10,9 @@ typedef u8 square_t; // e4, Nf6, Qh3+, Qe1#, a8=Q, i need to store the information needed to // recreate this in move_t enum { - MOVE_CAPTURE = 1, - MOVE_SHORT_CASTLE = 1 << 1, - MOVE_LONG_CASTLE = 1 << 2, + MOVE_CAPTURE = 1, + MOVE_SHORT_CASTLE = 1 << 1, + MOVE_LONG_CASTLE = 1 << 2, // technically these promotation flags can be compressed to only use 2 bits.. MOVE_PROMOTE_Q = 1 << 3, // 1 << 5 @@ -28,10 +28,10 @@ typedef struct { square_t to; u16 flags; } move_t; -void position_make_move(position_t* position, move_t* move); +void position_make_move(position_t *position, move_t *move); typedef struct { - move_t* moves; + move_t *moves; u32 length; u32 capacity; } moves_t; @@ -50,32 +50,34 @@ struct add_move_params { (struct add_move_params) { .flags = 0, __VA_ARGS__ }\ ) void _add_move( - moves_t* moves, + moves_t *moves, square_t from, square_t to, struct add_move_params params ); -void get_pawn_moves(moves_t* moves, position_t position); -void get_knight_moves(moves_t* moves, position_t position); -void get_king_moves(moves_t* moves, position_t position); -void get_rook_moves(moves_t* moves, position_t position); -void get_bishop_moves(moves_t* moves, position_t position); -void get_queen_moves(moves_t* moves, position_t position); +void get_pawn_moves(moves_t *moves, position_t position); +void get_knight_moves(moves_t *moves, position_t position); +void get_king_moves(moves_t *moves, position_t position); +void get_rook_moves(moves_t *moves, position_t position); +void get_bishop_moves(moves_t *moves, position_t position); +void get_queen_moves(moves_t *moves, position_t position); -void get_moves(moves_t* moves, position_t position); +void get_moves(moves_t *moves, position_t position); +#ifdef MOVES_INTERNAL void __forloop_rook_moves_gen( - moves_t* moves, + moves_t *moves, bitboard_t friendly_type, bitboard_t friendly_pieces, bitboard_t enemy_pieces ); void __forloop_bishop_moves_gen( - moves_t* moves, + moves_t *moves, bitboard_t friendly_type, bitboard_t friendly_pieces, bitboard_t enemy_pieces ); +#endif // MOVES_INTERNAL #endif // !MOVES_H |
