The pieces are defined as an enumeration to add to the clarity of the code.
enum class Pieces { empty, P, N, B, R, Q, K, p, n, b, r, q, k, offboard, enpassant };
They are converted to integers by casting, for instance:
int a = static_cast<int>(Pieces::Q) ;
Leave a Reply