Chess Engine
C++ chess engine with movegen, bitboards, and Arduino-friendly docs
|
#include <cstdio>
#include "defs.h"
#include "../move/move_generator.h"
#include "notation.h"
#include "setup.h"
Go to the source code of this file.
Functions | |
char * | squareToString (const int square) |
Convert a board square index to algebraic notation. | |
char * | moveToString (const int move) |
Convert an encoded move to coordinate notation. | |
int | parseMoveString (char *text, S_BOARD *board) |
Parse a move from coordinate notation. | |
void | printMoveList (const S_MOVELIST *moveList) |
Print all moves in a move list to stdout. |
char * moveToString | ( | int | move | ) |
Convert an encoded move to coordinate notation.
move | Encoded move integer. |
Definition at line 17 of file notation.cpp.
References fileIndex120, FROMSQ, IsBQ, IsKn, IsRQ, PROMOTED, rankIndex120, and TOSQ.
Referenced by PerftTest(), and printMoveList().
int parseMoveString | ( | char * | ptrChar, |
S_BOARD * | pos ) |
Parse a move from coordinate notation.
ptrChar | Pointer to a string containing the move (e.g., "e2e4", "e7e8q"). |
pos | Pointer to the current board state. |
Definition at line 48 of file notation.cpp.
References ASSERT, S_MOVELIST::count, EMPTY, FR2SQ, FROMSQ, generateAllMoves(), isBoardStateValid(), IsBQ, IsKn, IsRQ, S_MOVE::move, S_MOVELIST::moves, NOMOVE, PROMOTED, SqOnBoard(), and TOSQ.
void printMoveList | ( | const S_MOVELIST * | list | ) |
Print all moves in a move list to stdout.
list | Pointer to the move list to print. |
Definition at line 83 of file notation.cpp.
References S_MOVELIST::count, S_MOVE::move, S_MOVELIST::moves, moveToString(), and S_MOVE::score.
char * squareToString | ( | int | sq | ) |
Convert a board square index to algebraic notation.
sq | Board square index (0–119 in mailbox 120 format). |
Definition at line 7 of file notation.cpp.
References fileIndex120, and rankIndex120.
Referenced by LegalMovesFrom().