It’s really important to note that if a pawn gets promoted, it becomes the new piece, whatever that piece is. Either a knight, bishop, rook, or queen. While this was happening in the interface, it was not being recognized by picoEngine. Since picoEngine didn’t know it was promoted, it would “assume” a pawn was sitting there. This caused a lot of trouble with king safety calculations, as I’m sure you could understand.

if (sepVect[k].size() == 5) {
char newPiece = ‘-‘;
if (!m_whitesTurn) {
newPiece = tolower(sepVect[k].at(4);
} else {
newPiece = toupper(sepVect[k].at(4));
m_theBoard[second] = newPiece;

Fortunately the fix was pretty simple. I initiated a check, if there were 5 digits, then the fifth digit is the promotion piece! All I had to do was consider if it should be upper or lower case for my board, which was simply solved by inputting whose turn it was.

Linux – keep it simple.

Leave a Reply

Your email address will not be published. Required fields are marked *