Skip to content

Commit a9e40fa

Browse files
sync bowling (#570)
1 parent 63b60e4 commit a9e40fa

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

exercises/practice/bowling/.meta/tests.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[656ae006-25c2-438c-a549-f338e7ec7441]
613
description = "should be able to score a game with all zeros"
@@ -38,6 +45,9 @@ description = "rolling a spare with the two roll bonus does not get a bonus roll
3845
[576faac1-7cff-4029-ad72-c16bcada79b5]
3946
description = "strikes with the two roll bonus do not get bonus rolls"
4047

48+
[efb426ec-7e15-42e6-9b96-b4fca3ec2359]
49+
description = "last two strikes followed by only last bonus with non strike points"
50+
4151
[72e24404-b6c6-46af-b188-875514c0377b]
4252
description = "a strike with the one roll bonus after a spare in the last frame does not get a bonus"
4353

exercises/practice/bowling/bowling_spec.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ describe('bowling', function()
9494
assert.equal(18, scorer.score())
9595
end)
9696

97+
it('should correctly score last two strikes followed by only last bonus with points', function()
98+
roll_n_times(0, 16)
99+
scorer.roll(10)
100+
scorer.roll(10)
101+
scorer.roll(0)
102+
scorer.roll(1)
103+
assert.equal(31, scorer.score())
104+
end)
105+
97106
it('should not allow a bonus roll after rolling a spare after a strike on the last frame', function()
98107
roll_n_times(0, 18)
99108
scorer.roll(10)

0 commit comments

Comments
 (0)