implemented utility function: bitboard::utils::notation_from_square_number

This commit is contained in:
Varga Dávid Lajos
2025-11-11 14:21:11 +01:00
parent a6aba8801e
commit eebdfdbee2

View File

@@ -11,8 +11,19 @@ pub fn pop_msb(value: &mut u64) -> usize {
return idx;
}
const RANK_NUMBERS: [char; 8] = ['1', '2', '3', '4', '5', '6', '7', '8'];
const FILE_LETTERS: [char; 8] = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'];
pub fn notation_from_square_number(sq: u8) -> String {
return String::new();
let row = sq / 8;
let col = sq % 8;
let mut notation = String::new();
let row_not = RANK_NUMBERS[row as usize];
let col_not = FILE_LETTERS[col as usize];
notation.push(col_not);
notation.push(row_not);
return notation;
}