diff options
| author | Peter B. <peter.bezdek@gmail.com> | 2026-07-25 18:10:17 +0200 |
|---|---|---|
| committer | Peter B. <peter.bezdek@gmail.com> | 2026-07-25 18:10:17 +0200 |
| commit | 98e5c1107ad8f8b22b624ab13c3c96fcbb37cdd2 (patch) | |
| tree | 5d73061fc5a3db44b984452fcc909824b76a2a5c /src/main.cpp | |
| parent | 7d0364996c3d8b34d4634a163a0829fafcd42fca (diff) | |
| parent | f8d8c20695684a545b536e83a9977c25028232d5 (diff) | |
Merge branch 'main' of https://github.com/AdamMegaRules/chess
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; } |
