trackler 2.0.5.1 → 2.0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/tree-building/description.md +15 -3
- data/lib/trackler/version.rb +1 -1
- data/tracks/ecmascript/exercises/queen-attack/queen-attack.spec.js +1 -1
- data/tracks/elm/.gitignore +1 -0
- data/tracks/elm/.travis.yml +3 -3
- data/tracks/elm/SETUP.md +16 -3
- data/tracks/elm/bin/build.sh +10 -10
- data/tracks/elm/bin/install-elm-format +1 -1
- data/tracks/elm/docs/INSTALLATION.md +2 -2
- data/tracks/elm/docs/TESTS.md +3 -3
- data/tracks/elm/elm-package.json +5 -5
- data/tracks/elm/exercises/accumulate/{Accumulate.example → Accumulate.example.elm} +0 -0
- data/tracks/elm/exercises/accumulate/{AccumulateTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/accumulate/elm-package.json +4 -4
- data/tracks/elm/exercises/accumulate/package.json +13 -0
- data/tracks/elm/exercises/allergies/{Allergies.example → Allergies.example.elm} +2 -2
- data/tracks/elm/exercises/allergies/{AllergiesTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/allergies/elm-package.json +4 -4
- data/tracks/elm/exercises/allergies/package.json +13 -0
- data/tracks/elm/exercises/anagram/{Anagram.example → Anagram.example.elm} +0 -0
- data/tracks/elm/exercises/anagram/{AnagramTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/anagram/elm-package.json +4 -4
- data/tracks/elm/exercises/anagram/package.json +13 -0
- data/tracks/elm/exercises/atbash-cipher/{AtbashCipher.example → AtbashCipher.example.elm} +0 -0
- data/tracks/elm/exercises/atbash-cipher/{AtbashCipherTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/atbash-cipher/elm-package.json +4 -4
- data/tracks/elm/exercises/atbash-cipher/package.json +13 -0
- data/tracks/elm/exercises/bob/{Bob.example → Bob.example.elm} +0 -0
- data/tracks/elm/exercises/bob/{BobTests.elm → Tests.elm} +3 -3
- data/tracks/elm/exercises/bob/elm-package.json +4 -4
- data/tracks/elm/exercises/bob/package.json +13 -0
- data/tracks/elm/exercises/difference-of-squares/{DifferenceOfSquares.example → DifferenceOfSquares.example.elm} +1 -1
- data/tracks/elm/exercises/difference-of-squares/{DifferenceOfSquaresTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/difference-of-squares/elm-package.json +4 -4
- data/tracks/elm/exercises/difference-of-squares/package.json +13 -0
- data/tracks/elm/exercises/gigasecond/{Gigasecond.example → Gigasecond.example.elm} +0 -0
- data/tracks/elm/exercises/gigasecond/{GigasecondTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/gigasecond/elm-package.json +4 -4
- data/tracks/elm/exercises/gigasecond/package.json +13 -0
- data/tracks/elm/exercises/grade-school/{GradeSchool.example → GradeSchool.example.elm} +1 -1
- data/tracks/elm/exercises/grade-school/{GradeSchoolTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/grade-school/elm-package.json +4 -4
- data/tracks/elm/exercises/grade-school/package.json +13 -0
- data/tracks/elm/exercises/hamming/{Hamming.example → Hamming.example.elm} +0 -0
- data/tracks/elm/exercises/hamming/{HammingTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/hamming/elm-package.json +4 -4
- data/tracks/elm/exercises/hamming/package.json +13 -0
- data/tracks/elm/exercises/hello-world/HelloWorld.elm +8 -8
- data/tracks/elm/exercises/hello-world/{HelloWorld.example → HelloWorld.example.elm} +0 -0
- data/tracks/elm/exercises/hello-world/{HelloWorldTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/hello-world/elm-package.json +4 -4
- data/tracks/elm/exercises/hello-world/package.json +13 -0
- data/tracks/elm/exercises/hello-world/yarn.lock +1136 -0
- data/tracks/elm/exercises/largest-series-product/{LargestSeriesProduct.example → LargestSeriesProduct.example.elm} +0 -0
- data/tracks/elm/exercises/largest-series-product/{LargestSeriesProductTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/largest-series-product/elm-package.json +4 -4
- data/tracks/elm/exercises/largest-series-product/package.json +13 -0
- data/tracks/elm/exercises/leap/{Leap.example → Leap.example.elm} +0 -0
- data/tracks/elm/exercises/leap/{LeapTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/leap/elm-package.json +4 -4
- data/tracks/elm/exercises/leap/package.json +13 -0
- data/tracks/elm/exercises/list-ops/{ListOps.example → ListOps.example.elm} +0 -0
- data/tracks/elm/exercises/list-ops/{ListOpsTests.elm → Tests.elm} +14 -14
- data/tracks/elm/exercises/list-ops/elm-package.json +4 -4
- data/tracks/elm/exercises/list-ops/package.json +13 -0
- data/tracks/elm/exercises/nucleotide-count/{NucleotideCount.example → NucleotideCount.example.elm} +0 -0
- data/tracks/elm/exercises/nucleotide-count/{NucleotideCountTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/nucleotide-count/elm-package.json +4 -4
- data/tracks/elm/exercises/nucleotide-count/package.json +13 -0
- data/tracks/elm/exercises/pangram/{Pangram.example → Pangram.example.elm} +0 -0
- data/tracks/elm/exercises/pangram/{PangramTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/pangram/elm-package.json +4 -4
- data/tracks/elm/exercises/pangram/package.json +13 -0
- data/tracks/elm/exercises/phone-number/{PhoneNumber.example → PhoneNumber.example.elm} +0 -0
- data/tracks/elm/exercises/phone-number/{PhoneNumberTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/phone-number/elm-package.json +4 -4
- data/tracks/elm/exercises/phone-number/package.json +13 -0
- data/tracks/elm/exercises/raindrops/{Raindrops.example → Raindrops.example.elm} +0 -0
- data/tracks/elm/exercises/raindrops/{RaindropsTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/raindrops/elm-package.json +4 -4
- data/tracks/elm/exercises/raindrops/package.json +13 -0
- data/tracks/elm/exercises/rna-transcription/{RNATranscription.example → RNATranscription.example.elm} +0 -0
- data/tracks/elm/exercises/rna-transcription/{RNATranscriptionTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/rna-transcription/elm-package.json +4 -4
- data/tracks/elm/exercises/rna-transcription/package.json +13 -0
- data/tracks/elm/exercises/robot-simulator/{RobotSimulator.example → RobotSimulator.example.elm} +0 -0
- data/tracks/elm/exercises/robot-simulator/{RobotSimulatorTests.elm → Tests.elm} +4 -4
- data/tracks/elm/exercises/robot-simulator/elm-package.json +4 -4
- data/tracks/elm/exercises/robot-simulator/package.json +13 -0
- data/tracks/elm/exercises/roman-numerals/{RomanNumerals.example → RomanNumerals.example.elm} +0 -0
- data/tracks/elm/exercises/roman-numerals/{RomanNumeralsTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/roman-numerals/elm-package.json +4 -4
- data/tracks/elm/exercises/roman-numerals/package.json +13 -0
- data/tracks/elm/exercises/run-length-encoding/{RunLengthEncoding.example → RunLengthEncoding.example.elm} +2 -2
- data/tracks/elm/exercises/run-length-encoding/{RunLengthEncodingTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/run-length-encoding/elm-package.json +4 -4
- data/tracks/elm/exercises/run-length-encoding/package.json +13 -0
- data/tracks/elm/exercises/say/{Say.example → Say.example.elm} +0 -0
- data/tracks/elm/exercises/say/{SayTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/say/elm-package.json +4 -4
- data/tracks/elm/exercises/say/package.json +13 -0
- data/tracks/elm/exercises/scrabble-score/{ScrabbleScore.example → ScrabbleScore.example.elm} +0 -0
- data/tracks/elm/exercises/scrabble-score/{ScrabbleScoreTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/scrabble-score/elm-package.json +4 -4
- data/tracks/elm/exercises/scrabble-score/package.json +13 -0
- data/tracks/elm/exercises/series/{Series.example → Series.example.elm} +0 -0
- data/tracks/elm/exercises/series/{SeriesTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/series/elm-package.json +4 -4
- data/tracks/elm/exercises/series/package.json +13 -0
- data/tracks/elm/exercises/space-age/{SpaceAge.example → SpaceAge.example.elm} +0 -0
- data/tracks/elm/exercises/space-age/{SpaceAgeTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/space-age/elm-package.json +4 -4
- data/tracks/elm/exercises/space-age/package.json +13 -0
- data/tracks/elm/exercises/strain/{Strain.example → Strain.example.elm} +0 -0
- data/tracks/elm/exercises/strain/{StrainTests.elm → Tests.elm} +3 -3
- data/tracks/elm/exercises/strain/elm-package.json +4 -4
- data/tracks/elm/exercises/strain/package.json +13 -0
- data/tracks/elm/exercises/sublist/{Sublist.example → Sublist.example.elm} +0 -0
- data/tracks/elm/exercises/sublist/{SublistTests.elm → Tests.elm} +5 -5
- data/tracks/elm/exercises/sublist/elm-package.json +4 -4
- data/tracks/elm/exercises/sublist/package.json +13 -0
- data/tracks/elm/exercises/sum-of-multiples/{SumOfMultiples.example → SumOfMultiples.example.elm} +1 -1
- data/tracks/elm/exercises/sum-of-multiples/{SumOfMultiplesTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/sum-of-multiples/elm-package.json +4 -4
- data/tracks/elm/exercises/sum-of-multiples/package.json +13 -0
- data/tracks/elm/exercises/triangle/{TriangleTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/triangle/{Triangle.example → Triangle.example.elm} +1 -1
- data/tracks/elm/exercises/triangle/elm-package.json +4 -4
- data/tracks/elm/exercises/triangle/package.json +13 -0
- data/tracks/elm/exercises/word-count/{WordCountTests.elm → Tests.elm} +2 -2
- data/tracks/elm/exercises/word-count/{WordCount.example → WordCount.example.elm} +0 -0
- data/tracks/elm/exercises/word-count/elm-package.json +4 -4
- data/tracks/elm/exercises/word-count/package.json +13 -0
- data/tracks/elm/package.json +10 -0
- data/tracks/fsharp/exercises/beer-song/HINTS.md +2 -0
- data/tracks/fsharp/exercises/grade-school/HINTS.md +3 -0
- data/tracks/fsharp/exercises/tree-building/Example.fs +7 -3
- data/tracks/fsharp/exercises/tree-building/TreeBuilding.fs +7 -4
- data/tracks/fsharp/exercises/tree-building/TreeBuildingTest.fs +49 -49
- data/tracks/fsharp/exercises/wordy/HINTS.md +3 -0
- data/tracks/java/config.json +13 -1
- data/tracks/java/exercises/anagram/build.gradle +0 -1
- data/tracks/java/exercises/anagram/src/test/java/AnagramTest.java +17 -13
- data/tracks/java/exercises/etl/build.gradle +0 -2
- data/tracks/java/exercises/grade-school/build.gradle +0 -1
- data/tracks/java/exercises/grade-school/src/test/java/SchoolTest.java +17 -13
- data/tracks/java/exercises/linked-list/build.gradle +0 -1
- data/tracks/java/exercises/linked-list/src/test/java/DequeTest.java +16 -15
- data/tracks/java/exercises/meetup/build.gradle +0 -1
- data/tracks/java/exercises/meetup/src/test/java/MeetupTest.java +96 -95
- data/tracks/java/exercises/nth-prime/build.gradle +0 -1
- data/tracks/java/exercises/nth-prime/src/test/java/PrimeTest.java +6 -5
- data/tracks/java/exercises/palindrome-products/build.gradle +18 -0
- data/tracks/java/exercises/palindrome-products/src/example/java/Palindromes.java +77 -0
- data/tracks/java/exercises/palindrome-products/src/main/java/.keep +0 -0
- data/tracks/java/exercises/palindrome-products/src/test/java/PalindromesTest.java +162 -0
- data/tracks/java/exercises/settings.gradle +2 -0
- data/tracks/java/exercises/sum-of-multiples/src/example/java/SumOfMultiples.java +1 -2
- data/tracks/java/exercises/sum-of-multiples/src/main/java/SumOfMultiples.java +0 -1
- data/tracks/java/exercises/sum-of-multiples/src/test/{SumOfMultiplesTest.java → java/SumOfMultiplesTest.java} +12 -24
- data/tracks/java/exercises/wordy/build.gradle +17 -0
- data/tracks/java/exercises/wordy/src/example/java/WordProblemSolver.java +57 -0
- data/tracks/java/exercises/wordy/src/main/java/WordProblemSolver.java +5 -0
- data/tracks/java/exercises/wordy/src/test/java/WordProblemSolverTest.java +119 -0
- data/tracks/lua/docs/TESTS.md +1 -1
- data/tracks/ruby/lib/generator.rb +17 -8
- data/tracks/ruby/test/fixtures/exercises/alpha/.meta/.version +1 -0
- data/tracks/ruby/test/fixtures/exercises/alpha/alpha_test.rb +1 -0
- data/tracks/ruby/test/fixtures/exercises/alpha/example.rb +5 -0
- data/tracks/ruby/test/fixtures/exercises/alpha/example.tt +1 -0
- data/tracks/ruby/test/fixtures/metadata/exercises/alpha/canonical-data.json +11 -0
- data/tracks/ruby/test/generator_test.rb +54 -1
- data/tracks/swift/docs/TESTS.md +12 -12
- data/tracks/swift/{img/page_assets/001-splash.png → docs/img/tests_001-splash.png} +0 -0
- data/tracks/swift/{img/page_assets/002-templateChooser.png → docs/img/tests_002-templateChooser.png} +0 -0
- data/tracks/swift/{img/page_assets/003-nameProject.jpg → docs/img/tests_003-nameProject.jpg} +0 -0
- data/tracks/swift/{img/page_assets/004-saveProject.jpg → docs/img/tests_004-saveProject.jpg} +0 -0
- data/tracks/swift/{img/page_assets/005-folderLayout.png → docs/img/tests_005-folderLayout.png} +0 -0
- data/tracks/swift/{img/page_assets/006-newProjectInitial.jpg → docs/img/tests_006-newProjectInitial.jpg} +0 -0
- data/tracks/swift/{img/page_assets/007-fileInspectorUpdate.png → docs/img/tests_007-fileInspectorUpdate.png} +0 -0
- data/tracks/swift/{img/page_assets/008-templateChooserSwift.png → docs/img/tests_008-templateChooserSwift.png} +0 -0
- data/tracks/swift/{img/page_assets/009-importTestSource.png → docs/img/tests_009-importTestSource.png} +0 -0
- data/tracks/swift/{img/page_assets/010-testsImportExample.png → docs/img/tests_010-testsImportExample.png} +0 -0
- data/tracks/swift/{img/page_assets/011-finalLayoutExample.png → docs/img/tests_011-finalLayoutExample.png} +0 -0
- metadata +122 -134
- data/tracks/elm/exercises/accumulate/runtests.bat +0 -1
- data/tracks/elm/exercises/accumulate/runtests.sh +0 -2
- data/tracks/elm/exercises/allergies/runtests.bat +0 -1
- data/tracks/elm/exercises/allergies/runtests.sh +0 -2
- data/tracks/elm/exercises/anagram/runtests.bat +0 -1
- data/tracks/elm/exercises/anagram/runtests.sh +0 -2
- data/tracks/elm/exercises/atbash-cipher/runtests.bat +0 -1
- data/tracks/elm/exercises/atbash-cipher/runtests.sh +0 -2
- data/tracks/elm/exercises/bob/runtests.bat +0 -1
- data/tracks/elm/exercises/bob/runtests.sh +0 -2
- data/tracks/elm/exercises/difference-of-squares/runtests.bat +0 -1
- data/tracks/elm/exercises/difference-of-squares/runtests.sh +0 -2
- data/tracks/elm/exercises/gigasecond/runtests.bat +0 -1
- data/tracks/elm/exercises/gigasecond/runtests.sh +0 -2
- data/tracks/elm/exercises/grade-school/runtests.bat +0 -1
- data/tracks/elm/exercises/grade-school/runtests.sh +0 -2
- data/tracks/elm/exercises/hamming/runtests.bat +0 -1
- data/tracks/elm/exercises/hamming/runtests.sh +0 -2
- data/tracks/elm/exercises/hello-world/runtests.bat +0 -1
- data/tracks/elm/exercises/hello-world/runtests.sh +0 -2
- data/tracks/elm/exercises/largest-series-product/runtests.bat +0 -1
- data/tracks/elm/exercises/largest-series-product/runtests.sh +0 -2
- data/tracks/elm/exercises/leap/runtests.bat +0 -1
- data/tracks/elm/exercises/leap/runtests.sh +0 -2
- data/tracks/elm/exercises/list-ops/runtests.bat +0 -1
- data/tracks/elm/exercises/list-ops/runtests.sh +0 -2
- data/tracks/elm/exercises/nucleotide-count/runtests.bat +0 -1
- data/tracks/elm/exercises/nucleotide-count/runtests.sh +0 -2
- data/tracks/elm/exercises/pangram/runtests.bat +0 -1
- data/tracks/elm/exercises/pangram/runtests.sh +0 -2
- data/tracks/elm/exercises/phone-number/runtests.bat +0 -1
- data/tracks/elm/exercises/phone-number/runtests.sh +0 -2
- data/tracks/elm/exercises/raindrops/runtests.bat +0 -1
- data/tracks/elm/exercises/raindrops/runtests.sh +0 -2
- data/tracks/elm/exercises/rna-transcription/runtests.bat +0 -1
- data/tracks/elm/exercises/rna-transcription/runtests.sh +0 -2
- data/tracks/elm/exercises/robot-simulator/runtests.bat +0 -1
- data/tracks/elm/exercises/robot-simulator/runtests.sh +0 -2
- data/tracks/elm/exercises/roman-numerals/runtests.bat +0 -1
- data/tracks/elm/exercises/roman-numerals/runtests.sh +0 -2
- data/tracks/elm/exercises/run-length-encoding/runtests.bat +0 -1
- data/tracks/elm/exercises/run-length-encoding/runtests.sh +0 -2
- data/tracks/elm/exercises/say/runtests.bat +0 -1
- data/tracks/elm/exercises/say/runtests.sh +0 -2
- data/tracks/elm/exercises/scrabble-score/runtests.bat +0 -1
- data/tracks/elm/exercises/scrabble-score/runtests.sh +0 -2
- data/tracks/elm/exercises/series/runtests.bat +0 -1
- data/tracks/elm/exercises/series/runtests.sh +0 -2
- data/tracks/elm/exercises/space-age/runtests.bat +0 -1
- data/tracks/elm/exercises/space-age/runtests.sh +0 -2
- data/tracks/elm/exercises/strain/runtests.bat +0 -1
- data/tracks/elm/exercises/strain/runtests.sh +0 -2
- data/tracks/elm/exercises/sublist/runtests.bat +0 -1
- data/tracks/elm/exercises/sublist/runtests.sh +0 -2
- data/tracks/elm/exercises/sum-of-multiples/runtests.bat +0 -1
- data/tracks/elm/exercises/sum-of-multiples/runtests.sh +0 -2
- data/tracks/elm/exercises/triangle/runtests.bat +0 -1
- data/tracks/elm/exercises/triangle/runtests.sh +0 -2
- data/tracks/elm/exercises/word-count/runtests.bat +0 -1
- data/tracks/elm/exercises/word-count/runtests.sh +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b9773ecbde701eefef54d155c99ae2c605cd9abf
|
4
|
+
data.tar.gz: 5f50ee1153696ce79b5440aa424c0cbccdf490c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 909605d683b7f022647a5f046a40c35a8a12ab63c38dfb51e3fab6f1c7766d033ca368232a115162bf0a8e4e87ddbec626245e0f46c1179a84090d54ec404229
|
7
|
+
data.tar.gz: c352853d640a7f935b961d223c5ef202c30973982a2e0d65657eede8c18cc46c149fb9591ae1d7291c3a100046934a64ecedde199d53da45446d14d51a9a426b
|
@@ -6,6 +6,18 @@ reconstructed.
|
|
6
6
|
Your job will be to refactor a working but slow and ugly piece of code that
|
7
7
|
implements the tree building logic for highly abstracted records. The records
|
8
8
|
only contain an ID number and a parent ID number. The ID number is always
|
9
|
-
between 0 (inclusive) and the length of the record list (exclusive).
|
10
|
-
|
11
|
-
|
9
|
+
between 0 (inclusive) and the length of the record list (exclusive). All records
|
10
|
+
have a parent ID lower than their own ID, except for the root record, which has
|
11
|
+
a parent ID that's equal to its own ID.
|
12
|
+
|
13
|
+
An example tree:
|
14
|
+
|
15
|
+
<pre>
|
16
|
+
root (ID: 0, parent ID: 0)
|
17
|
+
|-- child1 (ID: 1, parent ID: 0)
|
18
|
+
| |-- grandchild1 (ID: 2, parent ID: 1)
|
19
|
+
| +-- grandchild2 (ID: 4, parent ID: 1)
|
20
|
+
+-- child2 (ID: 3, parent ID: 0)
|
21
|
+
| +-- grandchild3 (ID: 6, parent ID: 3)
|
22
|
+
+-- child3 (ID: 5, parent ID: 0)
|
23
|
+
</pre>
|
data/lib/trackler/version.rb
CHANGED
data/tracks/elm/.gitignore
CHANGED
data/tracks/elm/.travis.yml
CHANGED
@@ -7,8 +7,7 @@ sudo: false
|
|
7
7
|
install:
|
8
8
|
- nvm install 6
|
9
9
|
- nvm use 6
|
10
|
-
- npm install
|
11
|
-
- elm package install -y
|
10
|
+
- npm install
|
12
11
|
- bin/install-elm-format linux
|
13
12
|
- export PATH=$PATH:$PWD/bin
|
14
13
|
|
@@ -19,4 +18,5 @@ script:
|
|
19
18
|
|
20
19
|
cache:
|
21
20
|
directories:
|
22
|
-
|
21
|
+
- node_modules
|
22
|
+
- elm-stuff
|
data/tracks/elm/SETUP.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
|
-
##
|
1
|
+
## Elm Installation
|
2
2
|
|
3
|
-
|
3
|
+
Refer to the [exercism help page][http://exercism.io/languages/elm] for Elm installation and learning
|
4
|
+
resources.
|
4
5
|
|
5
|
-
|
6
|
+
## Writing the Code
|
7
|
+
|
8
|
+
The first time you start an exercise, you'll need to ensure you have the appropriate dependancies installed.
|
9
|
+
|
10
|
+
```bash
|
11
|
+
$ npm install
|
12
|
+
```
|
13
|
+
|
14
|
+
Execute the tests with:
|
15
|
+
|
16
|
+
```bash
|
17
|
+
$ npm test
|
18
|
+
```
|
data/tracks/elm/bin/build.sh
CHANGED
@@ -12,7 +12,7 @@ if [ $? -ne 0 ]; then
|
|
12
12
|
exit 1
|
13
13
|
fi
|
14
14
|
|
15
|
-
elm-format --yes --validate exercises
|
15
|
+
elm-format --yes --validate exercises/**/{*.example.elm,Tests.elm}
|
16
16
|
|
17
17
|
if [ $? -ne 0 ]; then
|
18
18
|
echo "*******************************************************************"
|
@@ -33,30 +33,30 @@ fi
|
|
33
33
|
declare -i TEST_RESULT=0
|
34
34
|
FAILED_EXERCISES=''
|
35
35
|
|
36
|
-
for example_file in exercises/**/*.example
|
36
|
+
for example_file in exercises/**/*.example.elm
|
37
37
|
do
|
38
38
|
exercise_dir=$(dirname $example_file)
|
39
|
-
|
40
|
-
mv "$exercise_dir/$
|
41
|
-
mv "$exercise_dir/$
|
39
|
+
exercise_name=$(basename $example_file .example.elm)
|
40
|
+
mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.impl"
|
41
|
+
mv "$exercise_dir/$exercise_name.example.elm" "$exercise_dir/$exercise_name.elm"
|
42
42
|
echo '-------------------------------------------------------'
|
43
|
-
echo "Testing $
|
43
|
+
echo "Testing $exercise_name"
|
44
44
|
|
45
45
|
# prevent elm-test from installing dependencies
|
46
46
|
mv $exercise_dir/elm-package.json $exercise_dir/elm-package.json.disabled
|
47
47
|
|
48
|
-
|
48
|
+
npm test -- $exercise_dir/Tests.elm
|
49
49
|
|
50
50
|
# capture result from last command (elm-test)
|
51
51
|
if [ $? -ne 0 ]; then
|
52
52
|
TEST_RESULT=1
|
53
|
-
FAILED_EXERCISES+="$
|
53
|
+
FAILED_EXERCISES+="$exercise_name\n"
|
54
54
|
fi
|
55
55
|
|
56
56
|
# be kind, rewind
|
57
57
|
mv $exercise_dir/elm-package.json.disabled $exercise_dir/elm-package.json
|
58
|
-
mv "$exercise_dir/$
|
59
|
-
mv "$exercise_dir/$
|
58
|
+
mv "$exercise_dir/$exercise_name.elm" "$exercise_dir/$exercise_name.example.elm"
|
59
|
+
mv "$exercise_dir/$exercise_name.impl" "$exercise_dir/$exercise_name.elm"
|
60
60
|
done
|
61
61
|
|
62
62
|
if [ $TEST_RESULT -ne 0 ]; then
|
@@ -12,7 +12,7 @@ case $(uname) in
|
|
12
12
|
echo "linux";;
|
13
13
|
esac)
|
14
14
|
|
15
|
-
URL=https://github.com/avh4/elm-format/releases/download/0.
|
15
|
+
URL=https://github.com/avh4/elm-format/releases/download/0.5.2-alpha/elm-format-0.18-0.5.2-alpha-$OS-x64.tgz
|
16
16
|
|
17
17
|
curl -L $URL | tar -xvzO > bin/elm-format
|
18
18
|
|
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
The simplest way to install Elm is via Node.js/NPM.
|
4
4
|
|
5
|
-
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running,
|
5
|
+
If you don't already have Node.js installed on your computer, you can download it from [the official site](https://nodejs.org/). Once you have Node.js up and running, run this command from inside an exercise directory to install the Elm platform and `elm-test`.
|
6
6
|
|
7
7
|
```bash
|
8
|
-
$ npm install
|
8
|
+
$ npm install
|
9
9
|
```
|
data/tracks/elm/docs/TESTS.md
CHANGED
@@ -2,15 +2,15 @@ The Elm exercise test suites may be run from the exercise directory.
|
|
2
2
|
|
3
3
|
```bash
|
4
4
|
$ cd exercism/project/directory/elm/hello-world
|
5
|
-
$
|
5
|
+
$ npm install # only required the first time you start an exercise
|
6
|
+
$ npm test
|
6
7
|
```
|
7
|
-
Replace `*` with the name of the exercise you're on, e.g. HelloWorld for the Hello World exercise.
|
8
8
|
|
9
9
|
## Hints and tips
|
10
10
|
|
11
11
|
### Coding the exercise
|
12
12
|
|
13
|
-
The README.md for each exercise gives a general description but the Elm test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running the test command before you have written anything and see if the error messages give you an idea of where to start.
|
13
|
+
The README.md for each exercise gives a general description, but the Elm test program will be very specific. Open the test program and give it a quick look - if it seems like cheating, do it anyway. Look for helpful comments, test data, and just the names of the test functions. Try running the test command before you have written anything and see if the error messages give you an idea of where to start.
|
14
14
|
|
15
15
|
Your first goal it to get something to compile, even though it fails tests. For this, you should "stub" functions. That means leave the body empty, except for whatever it must return. Write something like `myFunc param = 0` or whatever it takes just to get it to compile. Sometimes to figure out function types you will have to go back to the test program and read in more detail. Once you have figured out all the required function signatures, the test program will complain that `0` is the wrong answer. Now start filling in function bodies.
|
16
16
|
|
data/tracks/elm/elm-package.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"version": "
|
2
|
+
"version": "3.0.0",
|
3
3
|
"summary": "Exercism problems in Elm.",
|
4
4
|
"repository": "https://github.com/exercism/xelm.git",
|
5
5
|
"license": "BSD3",
|
@@ -38,9 +38,9 @@
|
|
38
38
|
],
|
39
39
|
"exposed-modules": [],
|
40
40
|
"dependencies": {
|
41
|
-
"elm-lang/core": "
|
42
|
-
"elm-community/elm-test": "
|
43
|
-
"rtfeldman/node-test-runner": "
|
41
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
42
|
+
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
43
|
+
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
44
44
|
},
|
45
|
-
"elm-version": "0.
|
45
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
46
46
|
}
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
port module Main exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run)
|
3
|
+
import Test.Runner.Node exposing (run, TestProgram)
|
4
4
|
import Json.Encode exposing (Value)
|
5
5
|
import Test exposing (..)
|
6
6
|
import Expect
|
@@ -31,7 +31,7 @@ tests =
|
|
31
31
|
]
|
32
32
|
|
33
33
|
|
34
|
-
main :
|
34
|
+
main : TestProgram
|
35
35
|
main =
|
36
36
|
run emit tests
|
37
37
|
|
@@ -8,9 +8,9 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "
|
12
|
-
"elm-community/elm-test": "
|
13
|
-
"rtfeldman/node-test-runner": "
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
12
|
+
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
+
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
14
14
|
},
|
15
|
-
"elm-version": "0.
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
16
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"description": "Excercism/Elm",
|
3
|
+
"repository": "https://github.com/exercism/xelm.git",
|
4
|
+
"license": "MIT",
|
5
|
+
"scripts": {
|
6
|
+
"postinstall": "elm-package install -y",
|
7
|
+
"test": "elm-test Tests.elm"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"elm": "^0.18.0",
|
11
|
+
"elm-test": "^0.18.0"
|
12
|
+
}
|
13
|
+
}
|
@@ -12,9 +12,9 @@ isAllergicTo name score =
|
|
12
12
|
toList : Int -> List String
|
13
13
|
toList score =
|
14
14
|
allergies
|
15
|
-
|> List.indexedMap (\i n -> ( Bitwise.
|
15
|
+
|> List.indexedMap (\i n -> ( Bitwise.shiftLeftBy i 1, n ))
|
16
16
|
|> List.filter (\( s, n ) -> Bitwise.and s score > 0)
|
17
|
-
|> List.map
|
17
|
+
|> List.map Tuple.second
|
18
18
|
|
19
19
|
|
20
20
|
allergies : List String
|
@@ -1,6 +1,6 @@
|
|
1
1
|
port module Main exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run)
|
3
|
+
import Test.Runner.Node exposing (run, TestProgram)
|
4
4
|
import Json.Encode exposing (Value)
|
5
5
|
import Test exposing (..)
|
6
6
|
import Expect
|
@@ -50,7 +50,7 @@ tests =
|
|
50
50
|
]
|
51
51
|
|
52
52
|
|
53
|
-
main :
|
53
|
+
main : TestProgram
|
54
54
|
main =
|
55
55
|
run emit tests
|
56
56
|
|
@@ -8,9 +8,9 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "
|
12
|
-
"elm-community/elm-test": "
|
13
|
-
"rtfeldman/node-test-runner": "
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
12
|
+
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
+
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
14
14
|
},
|
15
|
-
"elm-version": "0.
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
16
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"description": "Excercism/Elm",
|
3
|
+
"repository": "https://github.com/exercism/xelm.git",
|
4
|
+
"license": "MIT",
|
5
|
+
"scripts": {
|
6
|
+
"postinstall": "elm-package install -y",
|
7
|
+
"test": "elm-test Tests.elm"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"elm": "^0.18.0",
|
11
|
+
"elm-test": "^0.18.0"
|
12
|
+
}
|
13
|
+
}
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
port module Main exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run)
|
3
|
+
import Test.Runner.Node exposing (run, TestProgram)
|
4
4
|
import Json.Encode exposing (Value)
|
5
5
|
import Test exposing (..)
|
6
6
|
import Expect
|
@@ -93,7 +93,7 @@ tests =
|
|
93
93
|
]
|
94
94
|
|
95
95
|
|
96
|
-
main :
|
96
|
+
main : TestProgram
|
97
97
|
main =
|
98
98
|
run emit tests
|
99
99
|
|
@@ -8,9 +8,9 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "
|
12
|
-
"elm-community/elm-test": "
|
13
|
-
"rtfeldman/node-test-runner": "
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
12
|
+
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
+
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
14
14
|
},
|
15
|
-
"elm-version": "0.
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
16
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"description": "Excercism/Elm",
|
3
|
+
"repository": "https://github.com/exercism/xelm.git",
|
4
|
+
"license": "MIT",
|
5
|
+
"scripts": {
|
6
|
+
"postinstall": "elm-package install -y",
|
7
|
+
"test": "elm-test Tests.elm"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"elm": "^0.18.0",
|
11
|
+
"elm-test": "^0.18.0"
|
12
|
+
}
|
13
|
+
}
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
port module Main exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run)
|
3
|
+
import Test.Runner.Node exposing (run, TestProgram)
|
4
4
|
import Json.Encode exposing (Value)
|
5
5
|
import Test exposing (..)
|
6
6
|
import Expect
|
@@ -37,7 +37,7 @@ tests =
|
|
37
37
|
]
|
38
38
|
|
39
39
|
|
40
|
-
main :
|
40
|
+
main : TestProgram
|
41
41
|
main =
|
42
42
|
run emit tests
|
43
43
|
|
@@ -8,9 +8,9 @@
|
|
8
8
|
],
|
9
9
|
"exposed-modules": [],
|
10
10
|
"dependencies": {
|
11
|
-
"elm-lang/core": "
|
12
|
-
"elm-community/elm-test": "
|
13
|
-
"rtfeldman/node-test-runner": "
|
11
|
+
"elm-lang/core": "5.0.0 <= v < 6.0.0",
|
12
|
+
"elm-community/elm-test": "3.0.0 <= v < 4.0.0",
|
13
|
+
"rtfeldman/node-test-runner": "3.0.0 <= v < 4.0.0"
|
14
14
|
},
|
15
|
-
"elm-version": "0.
|
15
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
16
16
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
{
|
2
|
+
"description": "Excercism/Elm",
|
3
|
+
"repository": "https://github.com/exercism/xelm.git",
|
4
|
+
"license": "MIT",
|
5
|
+
"scripts": {
|
6
|
+
"postinstall": "elm-package install -y",
|
7
|
+
"test": "elm-test Tests.elm"
|
8
|
+
},
|
9
|
+
"dependencies": {
|
10
|
+
"elm": "^0.18.0",
|
11
|
+
"elm-test": "^0.18.0"
|
12
|
+
}
|
13
|
+
}
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
1
|
port module Main exposing (..)
|
2
2
|
|
3
|
-
import Test.Runner.Node exposing (run)
|
3
|
+
import Test.Runner.Node exposing (run, TestProgram)
|
4
4
|
import Json.Encode exposing (Value)
|
5
5
|
import Test exposing (..)
|
6
6
|
import Expect
|
@@ -137,7 +137,7 @@ listOfCharacters length characterList =
|
|
137
137
|
|
138
138
|
gibberish : Int -> Random.Generator Char -> String
|
139
139
|
gibberish length characterList =
|
140
|
-
|
140
|
+
Tuple.first (Random.step (Random.map String.fromList (listOfCharacters length characterList)) (Random.initialSeed 424242))
|
141
141
|
|
142
142
|
|
143
143
|
uppercaseGibberish : Int -> String
|
@@ -150,7 +150,7 @@ gibberishQuestion length =
|
|
150
150
|
(gibberish length anyCharacter) ++ "?"
|
151
151
|
|
152
152
|
|
153
|
-
main :
|
153
|
+
main : TestProgram
|
154
154
|
main =
|
155
155
|
run emit tests
|
156
156
|
|