Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Jan 12, 2025
1 parent 91fbaf1 commit 39aeadf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions rust/bowling/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,8 @@ impl BowlingGame {
let next_frame = self.frames.get(frame_index + 1);
if next_frame.unwrap().is_strike() {
let next_next_frame = self.frames.get(frame_index + 2);
if next_next_frame.is_some() {
return (
Some(next_frame.unwrap().roll1),
Some(next_next_frame.unwrap().roll1),
);
if let Some(nnf) = next_next_frame {
return (Some(next_frame.unwrap().roll1), Some(nnf.roll1));
} else {
return (Some(next_frame.unwrap().roll1), self.fill_ball1);
}
Expand Down

0 comments on commit 39aeadf

Please sign in to comment.