feat: bot random strategy

This commit is contained in:
Henri Bourcereau 2025-08-08 16:24:12 +02:00
parent b02ce8d185
commit bf820ecc4e
10 changed files with 106 additions and 27 deletions

View file

@ -37,7 +37,7 @@ impl Default for CheckerMove {
impl CheckerMove {
pub fn to_display_string(self) -> String {
format!("{:?} ", self)
format!("{self:?} ")
}
pub fn new(from: Field, to: Field) -> Result<Self, Error> {
@ -569,7 +569,7 @@ impl Board {
}
let checker_color = self.get_checkers_color(field)?;
if Some(color) != checker_color {
println!("field invalid : {:?}, {:?}, {:?}", color, field, self);
println!("field invalid : {color:?}, {field:?}, {self:?}");
return Err(Error::FieldInvalid);
}
let unit = match color {