prise de coin par puissance

This commit is contained in:
Henri Bourcereau 2024-05-08 21:17:13 +02:00
parent 33ad73103b
commit a62e91a233
3 changed files with 153 additions and 5 deletions

View file

@ -93,6 +93,11 @@ impl Board {
Board::default()
}
/// Globally set pieces on board ( for tests )
pub fn set_positions(&mut self, positions: [i8; 24]) {
self.positions = positions;
}
// maybe todo : operate on bits (cf. https://github.com/bungogood/bkgm/blob/a2fb3f395243bcb0bc9f146df73413f73f5ea1e0/src/position.rs#L217)
pub fn to_gnupg_pos_id(&self) -> String {
// Pieces placement -> 77bits (24 + 23 + 30 max)