From 658a797ec8cb5b6d8607fac089e036685f2a3958 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 27 Jul 2026 10:26:54 +0200 Subject: adding enpassant --- src/moves.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/moves.cpp') diff --git a/src/moves.cpp b/src/moves.cpp index 7efd00a..81ea1df 100644 --- a/src/moves.cpp +++ b/src/moves.cpp @@ -70,6 +70,11 @@ void GeneratePawnMoves(Board *b, int from, std::vector &moves) { } int target = (position.rank + (pawn.color ? -1 : 1)) * 8 + targetFile; + + if (IndexToPosition(target) == b->enPassant && b->canEnpassant) { + // enpasstant!!!!!!! + moves.push_back({position, IndexToPosition(target)}); + } if (b->pieces[target].type != NONE && b->pieces[target].color != pawn.color) { moves.push_back({position, IndexToPosition(target)}); -- cgit v1.2.3