Chess Engine
C++ chess engine with movegen, bitboards, and Arduino-friendly docs
Loading...
Searching...
No Matches
move_generator.h
Go to the documentation of this file.
1// movegen.h
2#pragma once
3
4#include "../defs.h" // S_BOARD, S_MOVELIST, enums, etc.
5
7#define MOVE(f,t,ca,pro,fl) ( (f) | ((t) << 7) | ((ca) << 14) | ((pro) << 20) | (fl) )
8
10#define SQOFFBOARD(sq) (fileIndex120[(sq)] == OFFBOARD)
11
13extern const int LoopSlidePce[8];
14
16extern const int LoopNonSlidePce[6];
17
19extern const int LoopSlideIndex[2];
20
22extern const int LoopNonSlideIndex[2];
23
25extern const int pieceDirection[13][8];
26
28extern const int numberDirections[13];
29
31extern const int VictimScore[13];
32
34extern int MvvLvaScores[13][13];
35
40extern void InitMvvLva(void);
41
47extern void generateAllMoves(const S_BOARD *pos, S_MOVELIST *list);
48
54extern void generateAllCaptures(const S_BOARD *pos, S_MOVELIST *list);
55
62extern int moveExists(S_BOARD *pos, int move);
const int VictimScore[13]
Victim scoring table for MVV-LVA.
const int pieceDirection[13][8]
Direction offsets for each piece type.
static int MvvLvaScores[13][13]
const int LoopNonSlideIndex[2]
Indices into LoopNonSlidePce for white and black.
const int LoopNonSlidePce[6]
Non-sliding piece loop order for move generation.
const int numberDirections[13]
Number of valid directions for each piece type.
const int LoopSlidePce[8]
Sliding piece loop order for move generation.
const int LoopSlideIndex[2]
Indices into LoopSlidePce for white and black.
void generateAllMoves(const S_BOARD *pos, S_MOVELIST *list)
Generate all pseudo-legal moves for the side to move.
void InitMvvLva(void)
Initialize the MVV-LVA capture scoring table.
void generateAllCaptures(const S_BOARD *pos, S_MOVELIST *list)
Generate all pseudo-legal capture moves (including en passant).
int moveExists(S_BOARD *pos, int move)
Check if a given move exists in the current position.