Fix score being zero when first number is 5
This commit is contained in:
parent
1213b0bd8f
commit
2ed3ea0ae5
1 changed files with 1 additions and 5 deletions
|
|
@ -97,11 +97,7 @@ fn App() -> Element {
|
|||
td {
|
||||
class: "number",
|
||||
b {
|
||||
if row.len() <= 1 {
|
||||
{row.iter().sum::<u16>().to_string()}
|
||||
} else {
|
||||
{row.iter().take_while(|&&n| n != 5).sum::<u16>().to_string()}
|
||||
}
|
||||
{row.iter().enumerate().take_while(|(c, n)| *c < 1 && **n != 5).map(|(_, n)| n).sum::<u16>().to_string()}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue