trackler 2.2.1.86 → 2.2.1.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/reverse-string/metadata.yml +0 -1
- data/tracks/bash/CONTRIBUTING.md +129 -28
- data/tracks/bash/config/exercise_readme.go.tmpl +10 -4
- data/tracks/bash/exercises/acronym/README.md +8 -11
- data/tracks/bash/exercises/acronym/{acronym_tests.sh → acronym_test.sh} +0 -0
- data/tracks/bash/exercises/anagram/README.md +6 -1
- data/tracks/bash/exercises/anagram/anagram_test.sh +1 -1
- data/tracks/bash/exercises/armstrong-numbers/README.md +10 -2
- data/tracks/bash/exercises/atbash-cipher/README.md +6 -6
- data/tracks/bash/exercises/bob/README.md +8 -1
- data/tracks/bash/exercises/collatz-conjecture/README.md +11 -2
- data/tracks/bash/exercises/collatz-conjecture/{collatz_test.sh → collatz_conjecture_test.sh} +6 -6
- data/tracks/bash/exercises/difference-of-squares/README.md +6 -1
- data/tracks/bash/exercises/error-handling/README.md +13 -5
- data/tracks/bash/exercises/error-handling/error_handling_test.sh +18 -22
- data/tracks/bash/exercises/error-handling/example.sh +7 -6
- data/tracks/bash/exercises/gigasecond/.meta/hints.md +0 -5
- data/tracks/bash/exercises/gigasecond/README.md +36 -1
- data/tracks/bash/exercises/grains/README.md +10 -2
- data/tracks/bash/exercises/hamming/README.md +6 -1
- data/tracks/bash/exercises/hello-world/README.md +7 -2
- data/tracks/bash/exercises/leap/README.md +7 -2
- data/tracks/bash/exercises/luhn/README.md +7 -2
- data/tracks/bash/exercises/nucleotide-count/README.md +13 -22
- data/tracks/bash/exercises/pangram/README.md +7 -2
- data/tracks/bash/exercises/phone-number/README.md +10 -4
- data/tracks/bash/exercises/raindrops/README.md +6 -1
- data/tracks/bash/exercises/reverse-string/README.md +11 -2
- data/tracks/bash/exercises/rna-transcription/README.md +7 -2
- data/tracks/bash/exercises/roman-numerals/README.md +11 -2
- data/tracks/bash/exercises/triangle/README.md +5 -4
- data/tracks/bash/exercises/two-fer/README.md +7 -9
- data/tracks/bash/exercises/word-count/README.md +6 -2
- data/tracks/bash/exercises/word-count/example.sh +22 -13
- data/tracks/bash/scripts/canonical_data_check.sh +112 -0
- data/tracks/c/exercises/acronym/src/{example.h → acronym.h} +0 -0
- data/tracks/c/exercises/gigasecond/.meta/hints.md +124 -0
- data/tracks/c/exercises/gigasecond/README.md +126 -0
- data/tracks/c/exercises/isogram/src/{example.h → isogram.h} +0 -0
- data/tracks/c/exercises/meetup/.meta/hints.md +124 -0
- data/tracks/c/exercises/meetup/README.md +142 -12
- data/tracks/c/exercises/pangram/src/{example.h → pangram.h} +0 -0
- data/tracks/c/exercises/space-age/.meta/hints.md +124 -0
- data/tracks/c/exercises/space-age/README.md +127 -2
- data/tracks/elisp/bin/test-examples +11 -14
- data/tracks/elisp/config.json +9 -1
- data/tracks/elisp/exercises/acronym/README.md +13 -0
- data/tracks/elisp/exercises/acronym/acronym-test.el +28 -0
- data/tracks/elisp/exercises/acronym/acronym.el +11 -0
- data/tracks/elisp/exercises/acronym/example.el +14 -0
- data/tracks/elisp/exercises/bob/example.el +1 -3
- data/tracks/elisp/exercises/hamming/README.md +2 -0
- data/tracks/elisp/exercises/hamming/hamming-test.el +35 -12
- data/tracks/elisp/exercises/hamming/hamming.el +0 -3
- data/tracks/fsharp/exercises/custom-set/CustomSetTest.fs +206 -132
- data/tracks/fsharp/exercises/custom-set/Example.fs +2 -0
- data/tracks/fsharp/generators/Generators.fs +61 -0
- data/tracks/go/config.json +25 -2
- data/tracks/go/exercises/acronym/acronym_test.go +8 -0
- data/tracks/go/exercises/alphametics/.meta/gen.go +72 -0
- data/tracks/go/exercises/alphametics/.meta/hints.md +38 -0
- data/tracks/go/exercises/alphametics/README.md +93 -0
- data/tracks/go/exercises/alphametics/alphametics_test.go +33 -0
- data/tracks/go/exercises/alphametics/cases_test.go +59 -0
- data/tracks/go/exercises/alphametics/example.go +212 -0
- data/tracks/go/exercises/atbash-cipher/.meta/gen.go +6 -4
- data/tracks/go/exercises/atbash-cipher/cases_test.go +2 -2
- data/tracks/go/exercises/change/.meta/gen.go +7 -5
- data/tracks/go/exercises/change/cases_test.go +2 -2
- data/tracks/go/exercises/collatz-conjecture/.meta/gen.go +5 -3
- data/tracks/go/exercises/collatz-conjecture/cases_test.go +2 -2
- data/tracks/go/exercises/connect/.meta/gen.go +5 -3
- data/tracks/go/exercises/connect/cases_test.go +2 -2
- data/tracks/go/exercises/flatten-array/.meta/gen.go +5 -3
- data/tracks/go/exercises/flatten-array/cases_test.go +2 -2
- data/tracks/go/exercises/meetup/.meta/gen.go +19 -8
- data/tracks/go/exercises/meetup/cases_test.go +2 -2
- data/tracks/go/exercises/simple-linked-list/README.md +47 -0
- data/tracks/go/exercises/simple-linked-list/example.go +74 -0
- data/tracks/go/exercises/simple-linked-list/linked_list_test.go +210 -0
- data/tracks/idris/config.json +2 -2
- data/tracks/java/exercises/all-your-base/.meta/src/reference/java/BaseConverter.java +1 -5
- data/tracks/java/exercises/all-your-base/.meta/version +1 -1
- data/tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java +34 -10
- data/tracks/java/exercises/bob/README.md +2 -0
- data/tracks/java/exercises/kindergarten-garden/.meta/version +1 -0
- data/tracks/java/exercises/kindergarten-garden/src/test/java/KindergartenGardenTest.java +0 -55
- data/tracks/java/exercises/meetup/.meta/version +1 -0
- data/tracks/java/exercises/meetup/src/test/java/MeetupTest.java +32 -0
- data/tracks/java/exercises/parallel-letter-frequency/README.md +1 -0
- data/tracks/java/exercises/proverb/README.md +16 -10
- data/tracks/java/exercises/rail-fence-cipher/README.md +5 -6
- data/tracks/java/exercises/two-fer/README.md +1 -1
- data/tracks/java/exercises/word-search/.meta/version +1 -1
- data/tracks/java/exercises/word-search/src/test/java/WordSearcherTest.java +240 -2
- data/tracks/javascript/.eslintignore +0 -1
- data/tracks/javascript/exercises/palindrome-products/example.js +3 -3
- data/tracks/kotlin/docs/INSTALLATION.md +77 -68
- data/tracks/kotlin/docs/TESTS.md +41 -39
- data/tracks/perl6/exercises/acronym/acronym.t +20 -8
- data/tracks/perl6/exercises/acronym/example.yaml +1 -1
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +108 -66
- data/tracks/perl6/exercises/all-your-base/example.yaml +2 -2
- data/tracks/perl6/exercises/allergies/allergies.t +39 -15
- data/tracks/perl6/exercises/allergies/example.yaml +2 -2
- data/tracks/perl6/exercises/anagram/anagram.t +73 -40
- data/tracks/perl6/exercises/anagram/example.yaml +1 -1
- data/tracks/perl6/exercises/atbash-cipher/atbash-cipher.t +38 -15
- data/tracks/perl6/exercises/atbash-cipher/example.yaml +1 -1
- data/tracks/perl6/exercises/bob/bob.t +77 -27
- data/tracks/perl6/exercises/bob/example.yaml +1 -1
- data/tracks/perl6/exercises/flatten-array/example.yaml +1 -1
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +20 -8
- data/tracks/perl6/exercises/luhn/example.yaml +1 -1
- data/tracks/perl6/exercises/luhn/luhn.t +42 -16
- data/tracks/perl6/exercises/roman-numerals/README.md +68 -0
- data/tracks/php/exercises/gigasecond/gigasecond_test.php +1 -1
- data/tracks/python/docs/ABOUT.md +2 -2
- metadata +27 -10
- data/tracks/bash/docs/EXERCISE_README_INSERT.md +0 -3
- data/tracks/bash/exercises/word-count/example.awk +0 -12
- data/tracks/java/exercises/alphametics/src/main/java/.keep +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9831edbe740fe63ce68b6941ca2287b894679f2
|
|
4
|
+
data.tar.gz: f83171332fb232afefcf15ad51664fbf96e22dfd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ffc257c14ace22234f3c4701c993a3c78a46f298e3a9044fd0e2535f0a667ac1e20251e9433e5470bd6c2ce0d808ecbb4baf51806e94e6e1d99e8f0d738c7e7
|
|
7
|
+
data.tar.gz: 44e076dcdb1bba7f3b13e5627942efac6225ced9ed4d7b4d204900ec0fb2f2ee646926727d96a5fcc78fd131a20fad7e81bbb5a86c0de8f6ff0d4d705e34f333
|
data/lib/trackler/version.rb
CHANGED
data/tracks/bash/CONTRIBUTING.md
CHANGED
|
@@ -1,18 +1,39 @@
|
|
|
1
1
|
# Contributing to the Bash Track
|
|
2
2
|
|
|
3
|
-
There are a lot of great resources for contributing to Exercism in general
|
|
3
|
+
There are a lot of great resources for contributing to Exercism in general
|
|
4
|
+
already. Check out the [docs] repository for a larger overview and some more
|
|
5
|
+
general purpose instructions.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
[docs]: (https://github.com/exercism/docs)
|
|
8
|
+
|
|
9
|
+
A great way to get started contributing is [porting an exercise] from another
|
|
10
|
+
track! It helps you get into the repository, learn your way around, and see
|
|
11
|
+
how things are structured.
|
|
12
|
+
|
|
13
|
+
[porting an exercise]: (#porting-an-exercise-from-another-language)
|
|
6
14
|
|
|
7
15
|
## Getting Set Up
|
|
8
16
|
|
|
9
|
-
In order to run any of the test files (or examples, for that matter), you're
|
|
17
|
+
In order to run any of the test files (or examples, for that matter), you're
|
|
18
|
+
going to need Bash. If you're on OSX or Linux, this shouldn't be a problem for
|
|
19
|
+
you. Additionally, you'll need the Bash test runner that we're using: `bats`.
|
|
20
|
+
This can be installed via your package manager. For more specifics, see the
|
|
21
|
+
[tests page] of this repositorys docs.
|
|
22
|
+
|
|
23
|
+
[tests page]: https://github.com/exercism/bash/blob/master/docs/TESTS.md
|
|
10
24
|
|
|
11
25
|
## Porting an Exercise from Another Language
|
|
12
26
|
|
|
13
|
-
Porting an exercise from another language is easy (ish)! [Problem
|
|
27
|
+
Porting an exercise from another language is easy (ish)! [Problem
|
|
28
|
+
specifications] for [unimplemented exercises] can be used to do this.
|
|
14
29
|
|
|
15
|
-
|
|
30
|
+
[Problem specifications]: www.github.com/exercism/problem-specifications
|
|
31
|
+
[unimplemented exercises]: www.exercism.io/languages/bash/todo
|
|
32
|
+
|
|
33
|
+
The `_template` directory found in `exercism/bash` can be used to port
|
|
34
|
+
exercises. Once an example submission, full test suite and README.md have been
|
|
35
|
+
created, you just need to alter `config.json` to include the newly implemented
|
|
36
|
+
exercise.
|
|
16
37
|
|
|
17
38
|
### Initial Setup
|
|
18
39
|
|
|
@@ -27,7 +48,17 @@ $ git clone https://github.com/<your-user-name>/bash.git
|
|
|
27
48
|
$ cd bash
|
|
28
49
|
```
|
|
29
50
|
|
|
30
|
-
Look through the [list of exercises not yet implemented in Bash
|
|
51
|
+
Look through the [list of exercises not yet implemented] in Bash. Once you've
|
|
52
|
+
found one you like, make sure that someone's not already working on it by
|
|
53
|
+
checking the [current open pull requests]. Also double check that the exercise
|
|
54
|
+
isn't in the list of exercises already implemented in your freshly cloned
|
|
55
|
+
repository: `path/to/bash/exercises`. Once you've selected an exercise you
|
|
56
|
+
like, locate its *slug* (unique name) in the [master list] of problem
|
|
57
|
+
specifications.
|
|
58
|
+
|
|
59
|
+
[list of exercises not yet implemented]: http://exercism.io/languages/bash/todo
|
|
60
|
+
[current open pull requests]: https://github.com/exercism/bash/pulls
|
|
61
|
+
[master list]: https://github.com/exercism/problem-specifications/tree/master/exercises
|
|
31
62
|
|
|
32
63
|
Create a directory in your local `exercises` folder with that same slug name.
|
|
33
64
|
|
|
@@ -38,7 +69,10 @@ $ git checkout -b <your-slug-here>
|
|
|
38
69
|
$ mkdir exercises/<your-slug-here>
|
|
39
70
|
```
|
|
40
71
|
|
|
41
|
-
At the very least, you're going to need to create a `README.md`, a test file
|
|
72
|
+
At the very least, you're going to need to create a `README.md`, a test file
|
|
73
|
+
(`your_exercise_test.sh`), and an example file which, by convention, you should
|
|
74
|
+
name `example.sh` when you're done. For ease of debugging, you can start by
|
|
75
|
+
naming your file `your_exercise.sh`.
|
|
42
76
|
|
|
43
77
|
```bash
|
|
44
78
|
$ touch README.md
|
|
@@ -52,15 +86,29 @@ Ensure that both of the shell script files are executeable.
|
|
|
52
86
|
$ chmod a+x <your-exercise>_test.sh <your-exercise>.sh
|
|
53
87
|
```
|
|
54
88
|
|
|
55
|
-
Many, if not all, of the current exercises have *canonical data* about them
|
|
89
|
+
Many, if not all, of the current exercises have *canonical data* about them
|
|
90
|
+
that is the same accross all languages. This makes it so you don't have to
|
|
91
|
+
come up with test cases or informative intro material yourself. You're
|
|
92
|
+
welcome! Head over to your specific exercise page in the [master list] (same
|
|
93
|
+
link as above). Specifically right now, you're interested in
|
|
94
|
+
`canonical_data.json`.
|
|
56
95
|
|
|
57
96
|

|
|
58
97
|
|
|
59
|
-
Currently, you're interested in all of the `"cases"`. Each of these is a test
|
|
98
|
+
Currently, you're interested in all of the `"cases"`. Each of these is a test
|
|
99
|
+
case that you'll have to implement in the specific vernacular of our
|
|
100
|
+
test-runner, `bats`. Check out this repository's [test documentation] if you
|
|
101
|
+
missed the [Getting Set Up] section above.
|
|
102
|
+
|
|
103
|
+
[test documentation]: https://github.com/exercism/bash/blob/master/docs/TESTS.md
|
|
104
|
+
[Getting Set Up]: #getting-set-up
|
|
60
105
|
|
|
61
106
|
### Generating the Tests
|
|
62
107
|
|
|
63
|
-
Implement each of the test cases (along with any comments or explanations you
|
|
108
|
+
Implement each of the test cases (along with any comments or explanations you
|
|
109
|
+
think are necessary for people who aren't sure of themselves). When in doubt,
|
|
110
|
+
check out the other, already implemented exercises for an example. Here's an
|
|
111
|
+
example of implementing the test case shown above.
|
|
64
112
|
|
|
65
113
|
```bash
|
|
66
114
|
#!/usr/bin/env bats
|
|
@@ -75,9 +123,22 @@ Implement each of the test cases (along with any comments or explanations you th
|
|
|
75
123
|
# ... The rest of your tests
|
|
76
124
|
```
|
|
77
125
|
|
|
78
|
-
For each test you create, you should use the `description` value for the test
|
|
79
|
-
|
|
80
|
-
|
|
126
|
+
For each test you create, you should use the `description` value for the test
|
|
127
|
+
case description. The `property` value is generally used by other languages to
|
|
128
|
+
specify what the function to be run is called. Use your best judgement and
|
|
129
|
+
check out how other exercises handle this. If there's just one property, you
|
|
130
|
+
can just test the script as a whole. If there's multiple properties, consider
|
|
131
|
+
testing those as either subcommands or flags (e.g. an exercise with an encode
|
|
132
|
+
and a decode property could be handled by `run bash cyper.sh encode <argument>`
|
|
133
|
+
or by `run bash cypher.sh -e <argument>`). You're the one writing the tests,
|
|
134
|
+
so you decide. You'll get feedback when you open your pull request anyways, so
|
|
135
|
+
don't stress too much about it.
|
|
136
|
+
|
|
137
|
+
For test cases that are expected to return `true` or `false` make sure you are
|
|
138
|
+
expecting an output value. It is better to return `"true"` or `true`, to the
|
|
139
|
+
console instead of just relying on the exit status in bash (0 for success,
|
|
140
|
+
1-255 for error). This will be consistent with the existing exercises and
|
|
141
|
+
prevent possible issues in the future.
|
|
81
142
|
|
|
82
143
|
You can check to see if your example script works by running `bats`.
|
|
83
144
|
|
|
@@ -85,17 +146,37 @@ You can check to see if your example script works by running `bats`.
|
|
|
85
146
|
$ bats hello_world_test.sh
|
|
86
147
|
```
|
|
87
148
|
|
|
149
|
+
#### Bash Style Guide
|
|
150
|
+
|
|
151
|
+
When creating the tests, the tests should follow the [bash style guide]
|
|
152
|
+
to avoid having an inconsistent style. The tests are delivered as a
|
|
153
|
+
product, and should be as idiomatic as possible, and this will help
|
|
154
|
+
maintain a certain level of consistency.
|
|
155
|
+
|
|
156
|
+
[bash style guide]: https://google.github.io/styleguide/shell.xml
|
|
157
|
+
|
|
88
158
|
### Implementing an Example Solution
|
|
89
159
|
|
|
90
|
-
If you've been following along so far, your tests should fail. Go ahead and
|
|
160
|
+
If you've been following along so far, your tests should fail. Go ahead and
|
|
161
|
+
implement your solution in the `<your-exercise>.sh` file. Make sure your file
|
|
162
|
+
has `#!/usr/bin/env bash` ([shebang]) at the top.
|
|
163
|
+
|
|
164
|
+
[shebang]: https://en.wikipedia.org/wiki/Shebang_(Unix)
|
|
91
165
|
|
|
92
|
-
Keep running your test file against it until your tests all pass. This process
|
|
166
|
+
Keep running your test file against it until your tests all pass. This process
|
|
167
|
+
should help ensure that both your tests *and* your example are ship shape!
|
|
93
168
|
|
|
94
|
-
Once your tests and example are complete, rename `<your-exercise>.sh` to
|
|
169
|
+
Once your tests and example are complete, rename `<your-exercise>.sh` to
|
|
170
|
+
`example.sh` to match all the other exercises.
|
|
95
171
|
|
|
96
172
|
### Updating the Config
|
|
97
173
|
|
|
98
|
-
Exercism makes heavy use of configuration files to automate things. Now that
|
|
174
|
+
Exercism makes heavy use of configuration files to automate things. Now that
|
|
175
|
+
you're done with your solution, you can add your problem to
|
|
176
|
+
`bash/config.json`. Check out the [configuration description] in the Exercism
|
|
177
|
+
docs for more info on each item.
|
|
178
|
+
|
|
179
|
+
[configuration description]: https://github.com/exercism/docs/blob/master/language-tracks/configuration/exercises.md
|
|
99
180
|
|
|
100
181
|
```javascript
|
|
101
182
|
// config.json
|
|
@@ -118,21 +199,31 @@ Exercism makes heavy use of configuration files to automate things. Now that yo
|
|
|
118
199
|
}
|
|
119
200
|
```
|
|
120
201
|
|
|
121
|
-
Possible topics that describe your exercise can come from the [topics master
|
|
202
|
+
Possible topics that describe your exercise can come from the [topics master
|
|
203
|
+
list], but you're not limited to those.
|
|
122
204
|
|
|
123
|
-
|
|
205
|
+
[topics master list]: https://github.com/exercism/problem-specifications/blob/master/TOPICS.txt
|
|
206
|
+
|
|
207
|
+
In order to get the `uuid` and check your work, you'll need the configlet,
|
|
208
|
+
which is a handy tool created to automate some of the more monotonous tasks
|
|
209
|
+
involved with this. See the [configlet documentation] for more info. Make
|
|
210
|
+
sure you have the most current configlet by running:
|
|
211
|
+
|
|
212
|
+
[configlet documentation]: (https://github.com/exercism/configlet)
|
|
124
213
|
|
|
125
214
|
```bash
|
|
126
215
|
$ bin/fetch-configlet
|
|
127
216
|
```
|
|
128
217
|
|
|
129
|
-
Each exercise *for each language* needs a unique ID number — a `uuid`. The
|
|
218
|
+
Each exercise *for each language* needs a unique ID number — a `uuid`. The
|
|
219
|
+
configlet can help you generate one.
|
|
130
220
|
|
|
131
221
|
```bash
|
|
132
222
|
$ bin/configlet uuid
|
|
133
223
|
```
|
|
134
224
|
|
|
135
|
-
Copy/paste the generated value into the `uuid` field of your exercise. Once
|
|
225
|
+
Copy/paste the generated value into the `uuid` field of your exercise. Once
|
|
226
|
+
you're done, it's time to check your work. Run the configlet linter.
|
|
136
227
|
|
|
137
228
|
```bash
|
|
138
229
|
$ bin/configlet lint .
|
|
@@ -144,21 +235,29 @@ Hopefully it says everything is OK!
|
|
|
144
235
|
|
|
145
236
|
### Creating the README
|
|
146
237
|
|
|
147
|
-
There are two ways to create the README: generate it via the configlet, or
|
|
238
|
+
There are two ways to create the README: generate it via the configlet, or
|
|
239
|
+
manually create it. This guide covers them both.
|
|
148
240
|
|
|
149
241
|
#### Using the Configlet
|
|
150
242
|
|
|
151
|
-
The configlet has a generate command that uses Go templating and pulls from the
|
|
243
|
+
The configlet has a generate command that uses Go templating and pulls from the
|
|
244
|
+
repository's `config` directory as well as each exercise's `.meta` directory.
|
|
245
|
+
For example, any necessary `hints.md` should be put in `.meta` so configlet may
|
|
246
|
+
pull it in. Learn more in the [configlet docs]. You should just be able to run:
|
|
247
|
+
|
|
248
|
+
[configlet docs]: https://github.com/exercism/configlet
|
|
152
249
|
|
|
153
250
|
```bash
|
|
154
251
|
$ bin/configlet generate <your-exercise>
|
|
155
252
|
```
|
|
156
253
|
|
|
157
|
-
This should auto-generate a nice README in your exercise directory. If it
|
|
254
|
+
This should auto-generate a nice README in your exercise directory. If it
|
|
255
|
+
gives you any issues, no worries! You can always get it done by...
|
|
158
256
|
|
|
159
257
|
#### Doing It Manually
|
|
160
258
|
|
|
161
|
-
Use the `config/exercise_readme.go.tmpl` file as a guide. The README should
|
|
259
|
+
Use the `config/exercise_readme.go.tmpl` file as a guide. The README should
|
|
260
|
+
look something like this:
|
|
162
261
|
|
|
163
262
|
```markdown
|
|
164
263
|
# <Your Exercise Title>
|
|
@@ -175,12 +274,15 @@ Use the `config/exercise_readme.go.tmpl` file as a guide. The README should loo
|
|
|
175
274
|
|
|
176
275
|
## Submitting Incomplete Solutions
|
|
177
276
|
|
|
178
|
-
It's possible to submit an incomplete solution so you can see how others have
|
|
277
|
+
It's possible to submit an incomplete solution so you can see how others have
|
|
278
|
+
completed the exercise.
|
|
179
279
|
```
|
|
180
280
|
|
|
181
281
|
### Cleaning Up
|
|
182
282
|
|
|
183
|
-
If you've been practicing good version control throughout this process, you may
|
|
283
|
+
If you've been practicing good version control throughout this process, you may
|
|
284
|
+
have several commits. At this point, you're almost ready to submit your pull
|
|
285
|
+
request, but you should rebase against the most recent upstream master branch.
|
|
184
286
|
|
|
185
287
|
```bash
|
|
186
288
|
# Assuming you've already 'git added' and 'git commited'
|
|
@@ -202,4 +304,3 @@ $ git push --force-with-lease origin <your-branch-name>
|
|
|
202
304
|
|
|
203
305
|
Good luck, happy scripting, and thanks for your help!
|
|
204
306
|
|
|
205
|
-
[shebang]: https://en.wikipedia.org/wiki/Shebang_(Unix)
|
|
@@ -4,10 +4,16 @@
|
|
|
4
4
|
{{- with .Hints }}
|
|
5
5
|
{{ . }}
|
|
6
6
|
{{ end }}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
|
|
8
|
+
Run the tests with:
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
bats {{ .Spec.SnakeCaseName }}_test.sh
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
|
15
|
+
|
|
16
|
+
{{ with .Spec.Credits -}}
|
|
11
17
|
## Source
|
|
12
18
|
|
|
13
19
|
{{ . }}
|
|
@@ -4,24 +4,21 @@ Convert a phrase to its acronym.
|
|
|
4
4
|
|
|
5
5
|
Techies love their TLA (Three Letter Acronyms)!
|
|
6
6
|
|
|
7
|
-
Help generate some jargon by writing a program that converts a long name
|
|
7
|
+
Help generate some jargon by writing a program that converts a long name
|
|
8
|
+
like Portable Network Graphics to its acronym (PNG).
|
|
8
9
|
|
|
9
|
-
Run the tests with:
|
|
10
|
-
|
|
11
|
-
bats acronym_tests.sh
|
|
12
|
-
|
|
13
|
-
## Submitting Exercises
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
Run the tests with:
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
```bash
|
|
14
|
+
bats acronym_test.sh
|
|
15
|
+
```
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
|
20
18
|
|
|
21
19
|
## Source
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
Julien Vanier [https://github.com/monkbroc](https://github.com/monkbroc)
|
|
24
22
|
|
|
25
23
|
## Submitting Incomplete Solutions
|
|
26
24
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
27
|
-
|
|
File without changes
|
|
@@ -6,9 +6,14 @@ Given `"listen"` and a list of candidates like `"enlists" "google"
|
|
|
6
6
|
"inlets" "banana"` the program should return a list containing
|
|
7
7
|
`"inlets"`.
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
Run the tests with:
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
```bash
|
|
13
|
+
bats anagram_test.sh
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
|
12
17
|
|
|
13
18
|
## Source
|
|
14
19
|
|
|
@@ -11,10 +11,18 @@ For example:
|
|
|
11
11
|
|
|
12
12
|
Write some code to determine whether a number is an Armstrong number.
|
|
13
13
|
|
|
14
|
+
|
|
15
|
+
Run the tests with:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
bats armstrong_numbers_test.sh
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
|
22
|
+
|
|
14
23
|
## Source
|
|
15
24
|
|
|
16
|
-
[
|
|
25
|
+
Wikipedia [https://en.wikipedia.org/wiki/Narcissistic_number](https://en.wikipedia.org/wiki/Narcissistic_number)
|
|
17
26
|
|
|
18
27
|
## Submitting Incomplete Solutions
|
|
19
|
-
|
|
20
28
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -9,7 +9,7 @@ letter, the second with the second-last, and so on.
|
|
|
9
9
|
|
|
10
10
|
An Atbash cipher for the Latin alphabet would be as follows:
|
|
11
11
|
|
|
12
|
-
```
|
|
12
|
+
```text
|
|
13
13
|
Plain: abcdefghijklmnopqrstuvwxyz
|
|
14
14
|
Cipher: zyxwvutsrqponmlkjihgfedcba
|
|
15
15
|
```
|
|
@@ -23,19 +23,19 @@ being 5 letters, and punctuation is excluded. This is to make it harder to guess
|
|
|
23
23
|
things based on word boundaries.
|
|
24
24
|
|
|
25
25
|
## Examples
|
|
26
|
+
|
|
26
27
|
- Encoding `test` gives `gvhg`
|
|
27
28
|
- Decoding `gvhg` gives `test`
|
|
28
29
|
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
|
|
29
30
|
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
Run the tests with:
|
|
32
33
|
|
|
33
|
-
```
|
|
34
|
-
|
|
34
|
+
```bash
|
|
35
|
+
bats atbash_cipher_test.sh
|
|
35
36
|
```
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
|
39
39
|
|
|
40
40
|
## Source
|
|
41
41
|
|
|
@@ -6,14 +6,21 @@ Bob answers 'Sure.' if you ask him a question.
|
|
|
6
6
|
|
|
7
7
|
He answers 'Whoa, chill out!' if you yell at him.
|
|
8
8
|
|
|
9
|
+
He answers 'Calm down, I know what I'm doing!' if you yell a question at him.
|
|
10
|
+
|
|
9
11
|
He says 'Fine. Be that way!' if you address him without actually saying
|
|
10
12
|
anything.
|
|
11
13
|
|
|
12
14
|
He answers 'Whatever.' to anything else.
|
|
13
15
|
|
|
16
|
+
|
|
14
17
|
Run the tests with:
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
```bash
|
|
20
|
+
bats bob_test.sh
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
After the first test(s) pass, continue by commenting out or removing the `skip` annotations prepending other tests.
|
|
17
24
|
|
|
18
25
|
## Source
|
|
19
26
|
|