-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bowling challenge #1604
base: main
Are you sure you want to change the base?
Bowling challenge #1604
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - well done Ana! As we discussed could maybe have unit tests as the only improvement I can think of!
} | ||
|
||
isStrike(){ | ||
return this.rolls[0] === 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice ! terse way to write
} | ||
|
||
score(){ | ||
let sum = this.rolls.reduce((acc, number) => acc + number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great use of reduce
|
||
} | ||
|
||
addFrame(...rolls){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
|
||
|
||
} //spare | ||
else if (currentFrame.isSpare() && this.hasNext(i)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider breaking this out into a separate function as this function is a little long
No description provided.