#include "board.h" BYTE notation_to_index(char file, int rank) { return (rank - 1) * 8 + (file - 'a'); } void index_to_notation(BYTE index, char notation[2]) { notation[0] = (index & 0b0111) + 'a'; notation[1] = (index >> 3) + '1'; }