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() {
|
if self.get(i, j).is_some() {
|
||||||
return Err("position is occupied");
|
return Err("position is occupied");
|
||||||
}
|
}
|
||||||
|
|
||||||
self.place_unchecked(i, j, piece);
|
self.place_unchecked(i, j, piece);
|
||||||
if self.propegate_from(i, j) > 0 {
|
if self.propegate_from(i, j) == 0 {
|
||||||
Ok(())
|
|
||||||
} else {
|
|
||||||
self.delete(i, j);
|
self.delete(i, j);
|
||||||
Err("move would not propegate")
|
Err("move would not propegate")
|
||||||
|
} else {
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user