Promotion time picoEngine!

picoEnginePawns

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s