Chess Engine
C++ chess engine with movegen, bitboards, and Arduino-friendly docs
|
Go to the source code of this file.
Functions | |
int | ParseSquare2 (const char *s) |
Parse "e2" style coordinate into a 120-based square index. | |
int | ParsePromotionPiece (char c, int side) |
Map promotion char ('q','r','b','n') to a piece code for the given side. Case-insensitive. Returns EMPTY if none/unknown. | |
int | LegalMovesFrom (S_BOARD *pos, int from, int outMoves[], char labels[][8], int maxOut) |
Build list of legal moves that originate from from. | |
int | MatchDestinationMove (S_BOARD *pos, int from, const char *destStr, const int legalMoves[], int nMoves) |
Resolve a destination string ("e4", "e8=Q", "e8q") to a move. |
int LegalMovesFrom | ( | S_BOARD * | pos, |
int | from, | ||
int | outMoves[], | ||
char | labels[][8], | ||
int | maxOut ) |
Build list of legal moves that originate from from.
pos | Board state. |
from | 120-based from-square. |
outMoves | Output array of encoded moves. |
labels | Output labels (e.g., "e4", "e8=Q"), each [8]. |
maxOut | Capacity of outMoves/labels. |
Definition at line 31 of file interactive_helpers.cpp.
References bB, bN, bQ, bR, S_MOVELIST::count, EMPTY, FROMSQ, generateAllMoves(), makeMove(), S_MOVE::move, S_MOVELIST::moves, PROMOTED, squareToString(), takeMove(), TOSQ, TRUE, wB, wN, wQ, and wR.
int MatchDestinationMove | ( | S_BOARD * | pos, |
int | from, | ||
const char * | destStr, | ||
const int | legalMoves[], | ||
int | nMoves ) |
Resolve a destination string ("e4", "e8=Q", "e8q") to a move.
Definition at line 64 of file interactive_helpers.cpp.
References bQ, EMPTY, FROMSQ, NOMOVE, ParsePromotionPiece(), ParseSquare2(), PROMOTED, S_BOARD::side, TOSQ, WHITE, and wQ.
int ParsePromotionPiece | ( | char | c, |
int | side ) |
Map promotion char ('q','r','b','n') to a piece code for the given side. Case-insensitive. Returns EMPTY if none/unknown.
Definition at line 19 of file interactive_helpers.cpp.
References bB, bN, bQ, bR, EMPTY, wB, WHITE, wN, wQ, and wR.
Referenced by MatchDestinationMove().
int ParseSquare2 | ( | const char * | s | ) |
Parse "e2" style coordinate into a 120-based square index.
Definition at line 10 of file interactive_helpers.cpp.
References FR2SQ.
Referenced by MatchDestinationMove().