Skip to content

Commit 45d9e97

Browse files
Sync say (#547)
1 parent 30c8908 commit 45d9e97

File tree

4 files changed

+39
-6
lines changed

4 files changed

+39
-6
lines changed

exercises/practice/say/.docs/instructions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ Implement breaking a number up into chunks of thousands.
3030

3131
So `1234567890` should yield a list like 1, 234, 567, and 890, while the far simpler `1000` should yield just 1 and 0.
3232

33-
The program must also report any values that are out of range.
34-
3533
## Step 3
3634

3735
Now handle inserting the appropriate scale word between those chunks.

exercises/practice/say/.meta/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
},
1616
"blurb": "Given a number from 0 to 999,999,999,999, spell out that number in English.",
1717
"source": "A variation on the JavaRanch CattleDrive, Assignment 4",
18-
"source_url": "https://coderanch.com/wiki/718804"
18+
"source_url": "https://web.archive.org/web/20240907035912/https://coderanch.com/wiki/718804"
1919
}

exercises/practice/say/.meta/tests.toml

Lines changed: 22 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
[5d22a120-ba0c-428c-bd25-8682235d83e8]
613
description = "zero"
@@ -17,12 +24,24 @@ description = "twenty"
1724
[d78601eb-4a84-4bfa-bf0e-665aeb8abe94]
1825
description = "twenty-two"
1926

27+
[f010d4ca-12c9-44e9-803a-27789841adb1]
28+
description = "thirty"
29+
30+
[738ce12d-ee5c-4dfb-ad26-534753a98327]
31+
description = "ninety-nine"
32+
2033
[e417d452-129e-4056-bd5b-6eb1df334dce]
2134
description = "one hundred"
2235

2336
[d6924f30-80ba-4597-acf6-ea3f16269da8]
2437
description = "one hundred twenty-three"
2538

39+
[2f061132-54bc-4fd4-b5df-0a3b778959b9]
40+
description = "two hundred"
41+
42+
[feed6627-5387-4d38-9692-87c0dbc55c33]
43+
description = "nine hundred ninety-nine"
44+
2645
[3d83da89-a372-46d3-b10d-de0c792432b3]
2746
description = "one thousand"
2847

exercises/practice/say/say_spec.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ describe('say', function()
2222
assert.are.equal('twenty-two', say(22))
2323
end)
2424

25+
it('should say 30', function()
26+
assert.are.equal('thirty', say(30))
27+
end)
28+
29+
it('should say 99', function()
30+
assert.are.equal('ninety-nine', say(99))
31+
end)
32+
2533
it('should say 100', function()
2634
assert.are.equal('one hundred', say(100))
2735
end)
@@ -30,6 +38,14 @@ describe('say', function()
3038
assert.are.equal('one hundred twenty-three', say(123))
3139
end)
3240

41+
it('should say 200', function()
42+
assert.are.equal('two hundred', say(200))
43+
end)
44+
45+
it('should say 999', function()
46+
assert.are.equal('nine hundred ninety-nine', say(999))
47+
end)
48+
3349
it('should say 1,000', function()
3450
assert.are.equal('one thousand', say(1000))
3551
end)

0 commit comments

Comments
 (0)