From f8d8c20695684a545b536e83a9977c25028232d5 Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 25 Jul 2026 18:07:29 +0200 Subject: adding get legal moves --- src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main.cpp') 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 #include "board.hpp" +#include "moves.hpp" Piece NonePiece = { false, NONE, false, }; +#include +void PrintMoves(const std::vector &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; } -- cgit v1.2.3