cli move checkers
This commit is contained in:
parent
68d361b562
commit
be0264f9a7
5 changed files with 120 additions and 15 deletions
|
|
@ -323,7 +323,7 @@ impl Board {
|
|||
if Some(color) != checker_color {
|
||||
return Err(Error::FieldInvalid);
|
||||
}
|
||||
self.positions[field] -= 1;
|
||||
self.positions[field - 1] -= 1;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ impl Board {
|
|||
if None != checker_color && Some(color) != checker_color {
|
||||
return Err(Error::FieldInvalid);
|
||||
}
|
||||
self.positions[field] += 1;
|
||||
self.positions[field - 1] += 1;
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue