diff options
| author | Adam <adammegarules1@gmail.com> | 2026-07-25 18:07:29 +0200 |
|---|---|---|
| committer | Adam <adammegarules1@gmail.com> | 2026-07-25 18:07:29 +0200 |
| commit | f8d8c20695684a545b536e83a9977c25028232d5 (patch) | |
| tree | f595b34cf56445e7dba2aa68663b9be9622bb511 /src/main.cpp | |
| parent | 1c6c1ed8ede9edf1860b1fbd5f2898b408689a05 (diff) | |
adding get legal moves
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index fa4b3a6..fd95755 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,13 +3,24 @@ #include <string> #include "board.hpp" +#include "moves.hpp" Piece NonePiece = { false, NONE, false, }; +#include <iostream> +void PrintMoves(const std::vector<Move> &moves) { + std::cout << "Moves (" << moves.size() << "):\n"; + + for (const Move &move : moves) { + std::cout << "(" << (int)move.From.file << ", " << (int)move.From.rank + << ") -> (" << (int)move.To.file << ", " << (int)move.To.rank + << ")\n"; + } +} int main(int argc, char **argv) { printf("arg count: %d", argc); std::string startingFen = @@ -31,5 +42,7 @@ int main(int argc, char **argv) { }; setBoardFen(startingFen, &b); printBoard(&b); + auto moves = GetLegalMoves(&b); + PrintMoves(moves); return EXIT_SUCCESS; } |
