flip an if statement

This commit is contained in:
Simon Gardling 2025-02-19 22:01:53 -05:00
parent 034607da0b
commit fe413b9ed2
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -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(())
}
}