mirrors for open_spiel
This commit is contained in:
parent
47142d593f
commit
d53b65c947
7 changed files with 164 additions and 30 deletions
|
|
@ -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}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue