diff options
Diffstat (limited to 'planetwars-rules/src/rules.rs')
-rw-r--r-- | planetwars-rules/src/rules.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/planetwars-rules/src/rules.rs b/planetwars-rules/src/rules.rs index 587098f..e339b4e 100644 --- a/planetwars-rules/src/rules.rs +++ b/planetwars-rules/src/rules.rs @@ -128,7 +128,7 @@ impl PwState { pub fn is_finished(&self) -> bool { let remaining = self.players.iter().filter(|p| p.alive).count(); - return remaining < 2 || self.turn_num >= self.max_turns; + remaining < 2 || self.turn_num >= self.max_turns } pub fn living_players(&self) -> Vec<usize> { @@ -187,6 +187,6 @@ impl Planet { fn distance(&self, other: &Planet) -> u64 { let dx = self.x - other.x; let dy = self.y - other.y; - return (dx.powi(2) + dy.powi(2)).sqrt().ceil() as u64; + (dx.powi(2) + dy.powi(2)).sqrt().ceil() as u64 } } |