mirrors for open_spiel

This commit is contained in:
Henri Bourcereau 2026-02-15 12:08:24 +01:00
parent 47142d593f
commit d53b65c947
7 changed files with 164 additions and 30 deletions

View file

@ -48,6 +48,16 @@ impl Player {
}
}
pub fn mirror(&self) -> Self {
let mut player = self.clone();
player.color = if self.color == Color::White {
Color::Black
} else {
Color::White
};
player
}
pub fn to_bits_string(&self) -> String {
format!(
"{:0>4b}{:0>4b}{:b}{:b}",