trackler 2.2.1.77 → 2.2.1.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/transpose/canonical-data.json +94 -116
- data/tracks/bash/config/maintainers.json +11 -1
- data/tracks/clojure/config.json +10 -2
- data/tracks/clojure/exercises/reverse-string/README.md +14 -0
- data/tracks/clojure/exercises/reverse-string/project.clj +4 -0
- data/tracks/clojure/exercises/reverse-string/src/example.clj +5 -0
- data/tracks/clojure/exercises/reverse-string/src/reverse_string.clj +5 -0
- data/tracks/clojure/exercises/reverse-string/test/reverse_string_test.clj +18 -0
- data/tracks/clojure/exercises/say/README.md +70 -0
- data/tracks/clojure/exercises/{two-fer → say}/project.clj +3 -3
- data/tracks/clojure/exercises/say/src/example.clj +9 -0
- data/tracks/clojure/exercises/say/src/say.clj +5 -0
- data/tracks/clojure/exercises/say/test/say_test.clj +48 -0
- data/tracks/coffeescript/docs/ABOUT.md +4 -9
- data/tracks/coffeescript/docs/INSTALLATION.md +2 -2
- data/tracks/erlang/exercises/pangram/rebar.config +1 -1
- data/tracks/erlang/exercises/pangram/src/example.erl +2 -3
- data/tracks/erlang/exercises/pangram/test/pangram_tests.erl +12 -13
- data/tracks/fsharp/exercises/grep/Example.fs +16 -20
- data/tracks/fsharp/exercises/grep/GrepTest.fs +154 -233
- data/tracks/fsharp/generators/Common.fs +7 -2
- data/tracks/fsharp/generators/Exercise.fs +51 -16
- data/tracks/fsharp/generators/Formatting.fs +13 -6
- data/tracks/fsharp/generators/Generators.fs +44 -14
- data/tracks/fsharp/generators/Rendering.fs +8 -1
- data/tracks/fsharp/generators/Templates/Generators/_GrepSetup.liquid +37 -0
- data/tracks/fsharp/generators/Templates/_TestClass.liquid +9 -3
- data/tracks/fsharp/generators/Templates/{_TestMethod.liquid → _TestFunction.liquid} +0 -0
- data/tracks/fsharp/generators/Templates/{_TestMethodBody.liquid → _TestFunctionBody.liquid} +0 -0
- data/tracks/fsharp/generators/Templates/_TestMember.liquid +3 -0
- data/tracks/fsharp/generators/Templates/_TestMemberBody.liquid +4 -0
- data/tracks/fsharp/generators/Templates/_TestModule.liquid +17 -0
- data/tracks/go/config.json +24 -0
- data/tracks/go/exercises/acronym/.meta/gen.go +5 -3
- data/tracks/go/exercises/acronym/acronym.go +0 -2
- data/tracks/go/exercises/acronym/cases_test.go +2 -2
- data/tracks/go/exercises/acronym/example.go +2 -3
- data/tracks/go/exercises/all-your-base/.meta/gen.go +9 -7
- data/tracks/go/exercises/all-your-base/cases_test.go +2 -2
- data/tracks/go/exercises/allergies/.meta/gen.go +10 -6
- data/tracks/go/exercises/allergies/cases_test.go +2 -2
- data/tracks/go/exercises/anagram/.meta/gen.go +7 -5
- data/tracks/go/exercises/anagram/cases_test.go +2 -2
- data/tracks/go/exercises/armstrong-numbers/.meta/gen.go +54 -0
- data/tracks/go/exercises/armstrong-numbers/armstrong_test.go +12 -0
- data/tracks/go/exercises/armstrong-numbers/cases_test.go +52 -0
- data/tracks/go/exercises/armstrong-numbers/example.go +24 -0
- data/tracks/go/exercises/binary-search/.meta/gen.go +7 -5
- data/tracks/go/exercises/binary-search/cases_test.go +2 -2
- data/tracks/go/exercises/book-store/.meta/gen.go +5 -3
- data/tracks/go/exercises/book-store/cases_test.go +2 -2
- data/tracks/go/exercises/connect/example.go +4 -5
- data/tracks/go/exercises/dominoes/.meta/gen.go +61 -0
- data/tracks/go/exercises/dominoes/.meta/hints.md +29 -0
- data/tracks/go/exercises/dominoes/README.md +67 -0
- data/tracks/go/exercises/dominoes/cases_test.go +72 -0
- data/tracks/go/exercises/dominoes/dominoes_test.go +106 -0
- data/tracks/go/exercises/dominoes/example.go +146 -0
- data/tracks/go/exercises/ledger/example.go +1 -1
- data/tracks/groovy/.gitignore +3 -0
- data/tracks/groovy/.travis.yml +10 -1
- data/tracks/groovy/bin/prepeare_exercise_builds.groovy +77 -0
- data/tracks/groovy/build.gradle +25 -0
- data/tracks/groovy/exercises/difference-of-squares/Example.groovy +3 -3
- data/tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy +3 -3
- data/tracks/groovy/exercises/linked-list/{DoubleLinkedList.groovy → LinkedList.groovy} +0 -0
- data/tracks/groovy/exercises/linked-list/{DoubleLinkedListSpec.groovy → LinkedListSpec.groovy} +0 -0
- data/tracks/groovy/exercises/linked-list/README.md +1 -1
- data/tracks/groovy/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/tracks/groovy/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/tracks/groovy/gradlew +172 -0
- data/tracks/groovy/gradlew.bat +84 -0
- data/tracks/groovy/settings.gradle +9 -0
- data/tracks/ocaml/exercises/acronym/.merlin +1 -1
- data/tracks/ocaml/exercises/all-your-base/.merlin +1 -1
- data/tracks/ocaml/exercises/anagram/.merlin +1 -1
- data/tracks/ocaml/exercises/atbash-cipher/.merlin +1 -1
- data/tracks/ocaml/exercises/beer-song/.merlin +1 -1
- data/tracks/ocaml/exercises/binary-search/.merlin +1 -1
- data/tracks/ocaml/exercises/bob/.merlin +1 -1
- data/tracks/ocaml/exercises/bowling/.merlin +1 -1
- data/tracks/ocaml/exercises/change/.merlin +1 -1
- data/tracks/ocaml/exercises/difference-of-squares/.merlin +1 -1
- data/tracks/ocaml/exercises/etl/.merlin +1 -1
- data/tracks/ocaml/exercises/forth/.merlin +1 -1
- data/tracks/ocaml/exercises/grade-school/.merlin +1 -1
- data/tracks/ocaml/exercises/hamming/.merlin +1 -1
- data/tracks/ocaml/exercises/hangman/.merlin +1 -1
- data/tracks/ocaml/exercises/hello-world/.merlin +1 -1
- data/tracks/ocaml/exercises/hexadecimal/.merlin +1 -1
- data/tracks/ocaml/exercises/leap/.merlin +1 -1
- data/tracks/ocaml/exercises/list-ops/.merlin +1 -1
- data/tracks/ocaml/exercises/luhn/.merlin +1 -1
- data/tracks/ocaml/exercises/meetup/.merlin +1 -1
- data/tracks/ocaml/exercises/minesweeper/.merlin +1 -1
- data/tracks/ocaml/exercises/nucleotide-count/.merlin +1 -1
- data/tracks/ocaml/exercises/phone-number/.merlin +1 -1
- data/tracks/ocaml/exercises/prime-factors/.merlin +1 -1
- data/tracks/ocaml/exercises/raindrops/.merlin +1 -1
- data/tracks/ocaml/exercises/react/.merlin +1 -1
- data/tracks/ocaml/exercises/rectangles/.merlin +1 -1
- data/tracks/ocaml/exercises/rna-transcription/.merlin +1 -1
- data/tracks/ocaml/exercises/run-length-encoding/.merlin +1 -1
- data/tracks/ocaml/exercises/say/.merlin +1 -1
- data/tracks/ocaml/exercises/space-age/.merlin +1 -1
- data/tracks/ocaml/exercises/triangle/.merlin +1 -1
- data/tracks/ocaml/exercises/word-count/.merlin +1 -1
- data/tracks/ocaml/exercises/zipper/.merlin +1 -1
- data/tracks/typescript/config/maintainers.json +2 -2
- metadata +37 -12
- data/tracks/clojure/exercises/two-fer/README.md +0 -19
- data/tracks/clojure/exercises/two-fer/src/example.clj +0 -5
- data/tracks/clojure/exercises/two-fer/src/two_fer.clj +0 -5
- data/tracks/clojure/exercises/two-fer/test/two_fer_test.clj +0 -12
- data/tracks/erlang/exercises/pangram/include/exercism.hrl +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c9b981950c88180c82d402ad10c2cad2fe1521a
|
4
|
+
data.tar.gz: 2cda694ae9c0522d67786b6b598afead61a3d89d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 995e912fd7358ce72fe0827f690c629e508aaa4265051a8d6b039c5493e332fb24390cfa14599506b20fb2fccf61b2db915da30d8546afcee98ae7265ad0922b
|
7
|
+
data.tar.gz: e57b484660dfd3207c19bc63e06f1e6891b4f0cad158004546e951f973105a87e1dc08cabc860e4c78364d65526f73cc6eec865c7e08516fad3bf7e3224f8a90
|
data/lib/trackler/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"exercise": "transpose",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.1.0",
|
4
4
|
"comments": [
|
5
5
|
"JSON doesn't allow for multi-line strings, so all multi-line input is ",
|
6
6
|
"presented here as arrays of strings. It's up to the test generator to join the ",
|
@@ -10,13 +10,19 @@
|
|
10
10
|
{
|
11
11
|
"description": "empty string",
|
12
12
|
"property": "transpose",
|
13
|
-
"input":
|
13
|
+
"input": {
|
14
|
+
"lines": []
|
15
|
+
},
|
14
16
|
"expected": []
|
15
17
|
},
|
16
18
|
{
|
17
19
|
"description": "two characters in a row",
|
18
20
|
"property": "transpose",
|
19
|
-
"input":
|
21
|
+
"input": {
|
22
|
+
"lines": [
|
23
|
+
"A1"
|
24
|
+
]
|
25
|
+
},
|
20
26
|
"expected": [
|
21
27
|
"A",
|
22
28
|
"1"
|
@@ -25,10 +31,12 @@
|
|
25
31
|
{
|
26
32
|
"description": "two characters in a column",
|
27
33
|
"property": "transpose",
|
28
|
-
"input":
|
29
|
-
"
|
30
|
-
|
31
|
-
|
34
|
+
"input": {
|
35
|
+
"lines": [
|
36
|
+
"A",
|
37
|
+
"1"
|
38
|
+
]
|
39
|
+
},
|
32
40
|
"expected": [
|
33
41
|
"A1"
|
34
42
|
]
|
@@ -36,10 +44,12 @@
|
|
36
44
|
{
|
37
45
|
"description": "simple",
|
38
46
|
"property": "transpose",
|
39
|
-
"input":
|
40
|
-
"
|
41
|
-
|
42
|
-
|
47
|
+
"input": {
|
48
|
+
"lines": [
|
49
|
+
"ABC",
|
50
|
+
"123"
|
51
|
+
]
|
52
|
+
},
|
43
53
|
"expected": [
|
44
54
|
"A1",
|
45
55
|
"B2",
|
@@ -49,7 +59,9 @@
|
|
49
59
|
{
|
50
60
|
"description": "single line",
|
51
61
|
"property": "transpose",
|
52
|
-
"input":
|
62
|
+
"input": {
|
63
|
+
"lines": ["Single line."]
|
64
|
+
},
|
53
65
|
"expected": [
|
54
66
|
"S",
|
55
67
|
"i",
|
@@ -68,10 +80,12 @@
|
|
68
80
|
{
|
69
81
|
"description": "first line longer than second line",
|
70
82
|
"property": "transpose",
|
71
|
-
"input":
|
72
|
-
"
|
73
|
-
|
74
|
-
|
83
|
+
"input": {
|
84
|
+
"lines": [
|
85
|
+
"The fourth line.",
|
86
|
+
"The fifth line."
|
87
|
+
]
|
88
|
+
},
|
75
89
|
"expected": [
|
76
90
|
"TT",
|
77
91
|
"hh",
|
@@ -94,10 +108,12 @@
|
|
94
108
|
{
|
95
109
|
"description": "second line longer than first line",
|
96
110
|
"property": "transpose",
|
97
|
-
"input":
|
98
|
-
"
|
99
|
-
|
100
|
-
|
111
|
+
"input": {
|
112
|
+
"lines": [
|
113
|
+
"The first line.",
|
114
|
+
"The second line."
|
115
|
+
]
|
116
|
+
},
|
101
117
|
"expected": [
|
102
118
|
"TT",
|
103
119
|
"hh",
|
@@ -117,16 +133,49 @@
|
|
117
133
|
" ."
|
118
134
|
]
|
119
135
|
},
|
136
|
+
{
|
137
|
+
"description": "mixed line length",
|
138
|
+
"property": "transpose",
|
139
|
+
"input": {
|
140
|
+
"lines": [
|
141
|
+
"The longest line.",
|
142
|
+
"A long line.",
|
143
|
+
"A longer line.",
|
144
|
+
"A line."
|
145
|
+
]
|
146
|
+
},
|
147
|
+
"expected": [
|
148
|
+
"TAAA",
|
149
|
+
"h ",
|
150
|
+
"elll",
|
151
|
+
" ooi",
|
152
|
+
"lnnn",
|
153
|
+
"ogge",
|
154
|
+
"n e.",
|
155
|
+
"glr",
|
156
|
+
"ei ",
|
157
|
+
"snl",
|
158
|
+
"tei",
|
159
|
+
" .n",
|
160
|
+
"l e",
|
161
|
+
"i .",
|
162
|
+
"n",
|
163
|
+
"e",
|
164
|
+
"."
|
165
|
+
]
|
166
|
+
},
|
120
167
|
{
|
121
168
|
"description": "square",
|
122
169
|
"property": "transpose",
|
123
|
-
"input":
|
124
|
-
"
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
170
|
+
"input": {
|
171
|
+
"lines": [
|
172
|
+
"HEART",
|
173
|
+
"EMBER",
|
174
|
+
"ABUSE",
|
175
|
+
"RESIN",
|
176
|
+
"TREND"
|
177
|
+
]
|
178
|
+
},
|
130
179
|
"expected": [
|
131
180
|
"HEART",
|
132
181
|
"EMBER",
|
@@ -138,12 +187,14 @@
|
|
138
187
|
{
|
139
188
|
"description": "rectangle",
|
140
189
|
"property": "transpose",
|
141
|
-
"input":
|
142
|
-
"
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
190
|
+
"input": {
|
191
|
+
"lines": [
|
192
|
+
"FRACTURE",
|
193
|
+
"OUTLINED",
|
194
|
+
"BLOOMING",
|
195
|
+
"SEPTETTE"
|
196
|
+
]
|
197
|
+
},
|
147
198
|
"expected": [
|
148
199
|
"FOBS",
|
149
200
|
"RULE",
|
@@ -158,14 +209,16 @@
|
|
158
209
|
{
|
159
210
|
"description": "triangle",
|
160
211
|
"property": "transpose",
|
161
|
-
"input":
|
162
|
-
"
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
212
|
+
"input": {
|
213
|
+
"lines": [
|
214
|
+
"T",
|
215
|
+
"EE",
|
216
|
+
"AAA",
|
217
|
+
"SSSS",
|
218
|
+
"EEEEE",
|
219
|
+
"RRRRRR"
|
220
|
+
]
|
221
|
+
},
|
169
222
|
"expected": [
|
170
223
|
"TEASER",
|
171
224
|
" EASER",
|
@@ -174,81 +227,6 @@
|
|
174
227
|
" ER",
|
175
228
|
" R"
|
176
229
|
]
|
177
|
-
},
|
178
|
-
{
|
179
|
-
"description": "many lines",
|
180
|
-
"property": "transpose",
|
181
|
-
"input": [
|
182
|
-
"Chor. Two households, both alike in dignity,",
|
183
|
-
"In fair Verona, where we lay our scene,",
|
184
|
-
"From ancient grudge break to new mutiny,",
|
185
|
-
"Where civil blood makes civil hands unclean.",
|
186
|
-
"From forth the fatal loins of these two foes",
|
187
|
-
"A pair of star-cross'd lovers take their life;",
|
188
|
-
"Whose misadventur'd piteous overthrows",
|
189
|
-
"Doth with their death bury their parents' strife.",
|
190
|
-
"The fearful passage of their death-mark'd love,",
|
191
|
-
"And the continuance of their parents' rage,",
|
192
|
-
"Which, but their children's end, naught could remove,",
|
193
|
-
"Is now the two hours' traffic of our stage;",
|
194
|
-
"The which if you with patient ears attend,",
|
195
|
-
"What here shall miss, our toil shall strive to mend."
|
196
|
-
],
|
197
|
-
"expected": [
|
198
|
-
"CIFWFAWDTAWITW",
|
199
|
-
"hnrhr hohnhshh",
|
200
|
-
"o oeopotedi ea",
|
201
|
-
"rfmrmash cn t",
|
202
|
-
".a e ie fthow ",
|
203
|
-
" ia fr weh,whh",
|
204
|
-
"Trnco miae ie",
|
205
|
-
"w ciroitr btcr",
|
206
|
-
"oVivtfshfcuhhe",
|
207
|
-
" eeih a uote ",
|
208
|
-
"hrnl sdtln is",
|
209
|
-
"oot ttvh tttfh",
|
210
|
-
"un bhaeepihw a",
|
211
|
-
"saglernianeoyl",
|
212
|
-
"e,ro -trsui ol",
|
213
|
-
"h uofcu sarhu ",
|
214
|
-
"owddarrdan o m",
|
215
|
-
"lhg to'egccuwi",
|
216
|
-
"deemasdaeehris",
|
217
|
-
"sr als t ists",
|
218
|
-
",ebk 'phool'h,",
|
219
|
-
" reldi ffd ",
|
220
|
-
"bweso tb rtpo",
|
221
|
-
"oea ileutterau",
|
222
|
-
"t kcnoorhhnatr",
|
223
|
-
"hl isvuyee'fi ",
|
224
|
-
" atv es iisfet",
|
225
|
-
"ayoior trr ino",
|
226
|
-
"l lfsoh ecti",
|
227
|
-
"ion vedpn l",
|
228
|
-
"kuehtteieadoe ",
|
229
|
-
"erwaharrar,fas",
|
230
|
-
" nekt te rh",
|
231
|
-
"ismdsehphnnosa",
|
232
|
-
"ncuse ra-tau l",
|
233
|
-
" et tormsural",
|
234
|
-
"dniuthwea'g t ",
|
235
|
-
"iennwesnr hsts",
|
236
|
-
"g,ycoi tkrttet",
|
237
|
-
"n ,l r s'a anr",
|
238
|
-
"i ef 'dgcgdi",
|
239
|
-
"t aol eoe,v",
|
240
|
-
"y nei sl,u; e",
|
241
|
-
", .sf to l ",
|
242
|
-
" e rv d t",
|
243
|
-
" ; ie o",
|
244
|
-
" f, r ",
|
245
|
-
" e e m",
|
246
|
-
" . m e",
|
247
|
-
" o n",
|
248
|
-
" v d",
|
249
|
-
" e .",
|
250
|
-
" ,"
|
251
|
-
]
|
252
230
|
}
|
253
231
|
]
|
254
232
|
}
|
@@ -19,6 +19,16 @@
|
|
19
19
|
"link_url": null,
|
20
20
|
"name": null,
|
21
21
|
"show_on_website": false
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"alumnus": false,
|
25
|
+
"avatar_url": null,
|
26
|
+
"bio": "I am a software developer and consultant working for Black Pepper Software, a software company based in Leamington Spa, England. I'm a recent Computer Science graduate from the University of Warwick, and love all things to do with computers!",
|
27
|
+
"github_username": "sjwarner-bp",
|
28
|
+
"link_text": null,
|
29
|
+
"link_url": null,
|
30
|
+
"name": "Sam Warner",
|
31
|
+
"show_on_website": true
|
22
32
|
}
|
23
33
|
]
|
24
|
-
}
|
34
|
+
}
|
data/tracks/clojure/config.json
CHANGED
@@ -12,10 +12,10 @@
|
|
12
12
|
{
|
13
13
|
"core": false,
|
14
14
|
"difficulty": 1,
|
15
|
-
"slug": "
|
15
|
+
"slug": "reverse-string",
|
16
16
|
"topics": null,
|
17
17
|
"unlocked_by": null,
|
18
|
-
"uuid": "
|
18
|
+
"uuid": "a8957cc5-d99e-4a31-9d49-4653226fd50b"
|
19
19
|
},
|
20
20
|
{
|
21
21
|
"core": false,
|
@@ -65,6 +65,14 @@
|
|
65
65
|
"unlocked_by": null,
|
66
66
|
"uuid": "04ac2bd0-504c-4faa-912e-d2111b46123c"
|
67
67
|
},
|
68
|
+
{
|
69
|
+
"core": false,
|
70
|
+
"difficulty": 1,
|
71
|
+
"slug": "say",
|
72
|
+
"topics": null,
|
73
|
+
"unlocked_by": null,
|
74
|
+
"uuid": "31aa2618-b971-44ff-9799-761fdec53b87"
|
75
|
+
},
|
68
76
|
{
|
69
77
|
"core": false,
|
70
78
|
"difficulty": 1,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Reverse String
|
2
|
+
|
3
|
+
Reverse a string
|
4
|
+
|
5
|
+
For example:
|
6
|
+
input: "cool"
|
7
|
+
output: "looc"
|
8
|
+
|
9
|
+
## Source
|
10
|
+
|
11
|
+
Introductory challenge to reverse an input string. [https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb](https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb)
|
12
|
+
|
13
|
+
## Submitting Incomplete Solutions
|
14
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,18 @@
|
|
1
|
+
(ns reverse-string-test
|
2
|
+
(:require [clojure.test :refer [deftest is]]
|
3
|
+
reverse-string))
|
4
|
+
|
5
|
+
(deftest empty-string-test
|
6
|
+
(is (= "" (reverse-string/reverse-string ""))))
|
7
|
+
|
8
|
+
(deftest a-word-test
|
9
|
+
(is (= "tobor" (reverse-string/reverse-string "robot"))))
|
10
|
+
|
11
|
+
(deftest capitalised-word-test
|
12
|
+
(is (= "nemaR" (reverse-string/reverse-string "Ramen"))))
|
13
|
+
|
14
|
+
(deftest sentence-with-punctuation-test
|
15
|
+
(is (= "!yrgnuh m'I" (reverse-string/reverse-string "I'm hungry!"))))
|
16
|
+
|
17
|
+
(deftest palindrome-test
|
18
|
+
(is (= "racecar" (reverse-string/reverse-string "racecar"))))
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Say
|
2
|
+
|
3
|
+
Given a number from 0 to 999,999,999,999, spell out that number in English.
|
4
|
+
|
5
|
+
## Step 1
|
6
|
+
|
7
|
+
Handle the basic case of 0 through 99.
|
8
|
+
|
9
|
+
If the input to the program is `22`, then the output should be
|
10
|
+
`'twenty-two'`.
|
11
|
+
|
12
|
+
Your program should complain loudly if given a number outside the
|
13
|
+
blessed range.
|
14
|
+
|
15
|
+
Some good test cases for this program are:
|
16
|
+
|
17
|
+
- 0
|
18
|
+
- 14
|
19
|
+
- 50
|
20
|
+
- 98
|
21
|
+
- -1
|
22
|
+
- 100
|
23
|
+
|
24
|
+
### Extension
|
25
|
+
|
26
|
+
If you're on a Mac, shell out to Mac OS X's `say` program to talk out
|
27
|
+
loud.
|
28
|
+
|
29
|
+
## Step 2
|
30
|
+
|
31
|
+
Implement breaking a number up into chunks of thousands.
|
32
|
+
|
33
|
+
So `1234567890` should yield a list like 1, 234, 567, and 890, while the
|
34
|
+
far simpler `1000` should yield just 1 and 0.
|
35
|
+
|
36
|
+
The program must also report any values that are out of range.
|
37
|
+
|
38
|
+
## Step 3
|
39
|
+
|
40
|
+
Now handle inserting the appropriate scale word between those chunks.
|
41
|
+
|
42
|
+
So `1234567890` should yield `'1 billion 234 million 567 thousand 890'`
|
43
|
+
|
44
|
+
The program must also report any values that are out of range. It's
|
45
|
+
fine to stop at "trillion".
|
46
|
+
|
47
|
+
## Step 4
|
48
|
+
|
49
|
+
Put it all together to get nothing but plain English.
|
50
|
+
|
51
|
+
`12345` should give `twelve thousand three hundred forty-five`.
|
52
|
+
|
53
|
+
The program must also report any values that are out of range.
|
54
|
+
|
55
|
+
### Extensions
|
56
|
+
|
57
|
+
Use _and_ (correctly) when spelling out the number in English:
|
58
|
+
|
59
|
+
- 14 becomes "fourteen".
|
60
|
+
- 100 becomes "one hundred".
|
61
|
+
- 120 becomes "one hundred and twenty".
|
62
|
+
- 1002 becomes "one thousand and two".
|
63
|
+
- 1323 becomes "one thousand three hundred and twenty-three".
|
64
|
+
|
65
|
+
## Source
|
66
|
+
|
67
|
+
This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)
|
68
|
+
|
69
|
+
## Submitting Incomplete Solutions
|
70
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|