-
-
Notifications
You must be signed in to change notification settings - Fork 555
[Bowling] Add edge case with fill balls in a last-frame strike #418
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] Add edge case with fill balls in a last-frame strike #418
Conversation
The previous test does not quite capture the behavior. If the first fill fill is a non-strikes, then the total fill-ball score must be less than 10. But, if the first fill ball is a strike, then the total fill-ball score must be less than 20. Because that first fill-ball strike resets the pins. I had what I thought was a working implementation but it totally missed the 2nd case. Adding a test to cover that case.
I'm also wondering about adding }, {
"description": "Two bonus rolls after a strike in the last frame can have a strike on the second roll",
"rolls": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 6, 10],
"expected": -1 To check for logic that looks for either of the fill balls being == 10 and then checking that the fill score is <= 20 |
Based on exercism/problem-specifications#418 These tests should capture all of the edge cases of validating the two balls that can come after a strike in the final frame
Case that is currently added 10, 10, 6 seems good. You might think 10, 6, 10 seems to overlap with our existing 10, 5, 6, so it would only fail if someone is special-casing 10. Admittedly, someone might, given the before test. Given that we can think of an implementation that would fail it that it seems like someone could write, seems good to add it, I think. |
This test checks that the fill balls validate correctly if the 2nd ball is a strike. exercism#418 (comment) .
|
Both these new tests seem reasonable. 👍 |
The new descriptions are capitalised which conflicts with the lowercase standardisation requested by #416. |
Oh dear I've made a mess of this 😢 sorry! |
@IanWhitney can you make another PR for this? I can't work out how to re-apply this PR through github. I merged this PR, then saw that it caused #416 to have conflicts and thought if I merged that one first I could merge this one without conflicts, so I reverted this merge and applied #416 but now I cant seem to re-apply this one. |
…ism#418) * Add edge case with fill balls in a last-frame strike The previous test does not quite capture the behavior. If the first fill fill is a non-strikes, then the total fill-ball score must be less than 10. But, if the first fill ball is a strike, then the total fill-ball score must be less than 20. Because that first fill-ball strike resets the pins. I had what I thought was a working implementation but it totally missed the 2nd case. Adding a test to cover that case. * Add edge case test for final-strike fill balls This test checks that the fill balls validate correctly if the 2nd ball is a strike.
…#423) * Add edge case with fill balls in a last-frame strike The previous test does not quite capture the behavior. If the first fill fill is a non-strikes, then the total fill-ball score must be less than 10. But, if the first fill ball is a strike, then the total fill-ball score must be less than 20. Because that first fill-ball strike resets the pins. I had what I thought was a working implementation but it totally missed the 2nd case. Adding a test to cover that case. * Add edge case test for final-strike fill balls This test checks that the fill balls validate correctly if the 2nd ball is a strike.
I think I've recovered this now, and don't need @IanWhitney to make another PR. Sorry everyone for the trouble. |
Based on exercism/problem-specifications#418 These tests should capture all of the edge cases of validating the two balls that can come after a strike in the final frame
* Use % for all expected arrays * Use symbols in all scale names * Add BookKeeping::VERSION
The previous test does not quite capture the behavior.
If the first fill fill is a non-strikes, then the total fill-ball score
must be less than 10.
But, if the first fill ball is a strike, then the total fill-ball score
must be less than 20. Because that first fill-ball strike resets the
pins.
I had what I thought was a working implementation but it totally missed
the 2nd case. Adding a test to cover that case.