flip an if statement
This commit is contained in:
parent
034607da0b
commit
fe413b9ed2
@ -269,12 +269,13 @@ impl Board {
|
||||
if self.get(i, j).is_some() {
|
||||
return Err("position is occupied");
|
||||
}
|
||||
|
||||
self.place_unchecked(i, j, piece);
|
||||
if self.propegate_from(i, j) > 0 {
|
||||
Ok(())
|
||||
} else {
|
||||
if self.propegate_from(i, j) == 0 {
|
||||
self.delete(i, j);
|
||||
Err("move would not propegate")
|
||||
} else {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user