After hours of toil and pain, I realized that I was going about this all wrong, and then in 15 minutes enabled the ability for picoEngine to choose to en passant. It is amazing how far off track I was, and how quickly it could be fixed when I was on the right path.
I was attempting to call a private product of the “Board” class, when I needed to simply make it a public class method that could be called. It’s a bit lengthy, but you can always take a look at my GitLab for the full commit. Here is the important snippet:
if (isPass){
if (i > 23 && i < 32) {
int passedPawn = 8;
if (enPass == ‘a’){ passedPawn = 0; }
else if (enPass == ‘b’){ passedPawn = 1; }
else if (enPass == ‘c’){ passedPawn = 2; }
else if (enPass == ‘d’){ passedPawn = 3; }
else if (enPass == ‘e’){ passedPawn = 4; }
else if (enPass == ‘f’){ passedPawn = 5; }
else if (enPass == ‘g’){ passedPawn = 6; }
else if (enPass == ‘h’){ passedPawn = 7; }
if (passedPawn – colNum == 1) {
theseMoves.push_back(i-7);
}
if (colNum – passedPawn == 1) {
theseMoves.push_back(i-9);
}
}}// End en passant moves
The best part is that picoEngine can now suggest an en passant move, which is an important part of the game of chess.
Linux – keep it simple.