trackler 2.2.1.40 → 2.2.1.41
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/.gitmodules +3 -0
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/dot-dsl/metadata.yml +1 -0
- data/problem-specifications/exercises/etl/metadata.yml +1 -0
- data/problem-specifications/exercises/isogram/canonical-data.json +3 -3
- data/problem-specifications/exercises/ocr-numbers/metadata.yml +1 -0
- data/problem-specifications/exercises/pascals-triangle/metadata.yml +1 -0
- data/problem-specifications/exercises/pov/metadata.yml +1 -0
- data/problem-specifications/exercises/rna-transcription/metadata.yml +1 -0
- data/problem-specifications/exercises/sgf-parsing/metadata.yml +1 -0
- data/tracks/c/exercises/all-your-base/src/example.c +14 -14
- data/tracks/c/exercises/all-your-base/src/example.h +2 -2
- data/tracks/ceylon/exercises/hamming/source/hamming/HammingTest.ceylon +1 -1
- data/tracks/ceylon/exercises/rna-transcription/source/rnatranscription/{RNAtest.ceylon → RNATest.ceylon} +0 -0
- data/tracks/cfml/.git +1 -0
- data/tracks/cfml/.gitignore +5 -0
- data/tracks/cfml/.travis.yml +18 -0
- data/tracks/cfml/CONTRIBUTING.md +10 -0
- data/tracks/cfml/LICENSE +21 -0
- data/tracks/cfml/README.md +92 -0
- data/tracks/cfml/bin/fetch-configlet +32 -0
- data/tracks/cfml/config/exercise_readme.go.tmpl +16 -0
- data/tracks/cfml/config/maintainers.json +13 -0
- data/tracks/cfml/config.json +223 -0
- data/tracks/cfml/docs/ABOUT.md +10 -0
- data/tracks/cfml/docs/EXERCISE_README_INSERT.md +15 -0
- data/tracks/cfml/docs/INSTALLATION.md +35 -0
- data/tracks/cfml/docs/LEARNING.md +37 -0
- data/tracks/cfml/docs/RESOURCES.md +29 -0
- data/tracks/cfml/docs/SNIPPET.txt +8 -0
- data/tracks/cfml/docs/TESTS.md +13 -0
- data/tracks/cfml/exercises/acronym/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/acronym/Acronym.cfc +13 -0
- data/tracks/cfml/exercises/acronym/AcronymTest.cfc +43 -0
- data/tracks/cfml/exercises/acronym/Solution.cfc +22 -0
- data/tracks/cfml/exercises/acronym/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/acronym/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/acronym/box.json +8 -0
- data/tracks/cfml/exercises/acronym/index.cfm +37 -0
- data/tracks/cfml/exercises/atbash-cipher/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/atbash-cipher/AtbashCipher.cfc +14 -0
- data/tracks/cfml/exercises/atbash-cipher/AtbashCipherTest.cfc +71 -0
- data/tracks/cfml/exercises/atbash-cipher/Solution.cfc +56 -0
- data/tracks/cfml/exercises/atbash-cipher/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/atbash-cipher/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/atbash-cipher/box.json +8 -0
- data/tracks/cfml/exercises/atbash-cipher/index.cfm +37 -0
- data/tracks/cfml/exercises/bob/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/bob/Bob.cfc +13 -0
- data/tracks/cfml/exercises/bob/BobTest.cfc +115 -0
- data/tracks/cfml/exercises/bob/Solution.cfc +27 -0
- data/tracks/cfml/exercises/bob/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/bob/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/bob/box.json +8 -0
- data/tracks/cfml/exercises/bob/index.cfm +37 -0
- data/tracks/cfml/exercises/diamond/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/diamond/Diamond.cfc +13 -0
- data/tracks/cfml/exercises/diamond/DiamondTest.cfc +35 -0
- data/tracks/cfml/exercises/diamond/Solution.cfc +35 -0
- data/tracks/cfml/exercises/diamond/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/diamond/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/diamond/box.json +8 -0
- data/tracks/cfml/exercises/diamond/index.cfm +37 -0
- data/tracks/cfml/exercises/difference-of-squares/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/difference-of-squares/DifferenceOfSquares.cfc +18 -0
- data/tracks/cfml/exercises/difference-of-squares/DifferenceOfSquaresTest.cfc +63 -0
- data/tracks/cfml/exercises/difference-of-squares/Solution.cfc +28 -0
- data/tracks/cfml/exercises/difference-of-squares/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/difference-of-squares/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/difference-of-squares/box.json +8 -0
- data/tracks/cfml/exercises/difference-of-squares/index.cfm +37 -0
- data/tracks/cfml/exercises/flatten-array/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/flatten-array/FlattenArray.cfc +13 -0
- data/tracks/cfml/exercises/flatten-array/FlattenArrayTest.cfc +42 -0
- data/tracks/cfml/exercises/flatten-array/Solution.cfc +26 -0
- data/tracks/cfml/exercises/flatten-array/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/flatten-array/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/flatten-array/box.json +8 -0
- data/tracks/cfml/exercises/flatten-array/index.cfm +37 -0
- data/tracks/cfml/exercises/gigasecond/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/gigasecond/Gigasecond.cfc +13 -0
- data/tracks/cfml/exercises/gigasecond/GigasecondTest.cfc +39 -0
- data/tracks/cfml/exercises/gigasecond/Solution.cfc +16 -0
- data/tracks/cfml/exercises/gigasecond/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/gigasecond/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/gigasecond/box.json +8 -0
- data/tracks/cfml/exercises/gigasecond/index.cfm +37 -0
- data/tracks/cfml/exercises/grains/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/grains/Grains.cfc +14 -0
- data/tracks/cfml/exercises/grains/GrainsTest.cfc +63 -0
- data/tracks/cfml/exercises/grains/Solution.cfc +22 -0
- data/tracks/cfml/exercises/grains/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/grains/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/grains/box.json +8 -0
- data/tracks/cfml/exercises/grains/index.cfm +37 -0
- data/tracks/cfml/exercises/hamming/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/hamming/Hamming.cfc +13 -0
- data/tracks/cfml/exercises/hamming/HammingTest.cfc +75 -0
- data/tracks/cfml/exercises/hamming/Solution.cfc +25 -0
- data/tracks/cfml/exercises/hamming/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/hamming/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/hamming/box.json +8 -0
- data/tracks/cfml/exercises/hamming/index.cfm +37 -0
- data/tracks/cfml/exercises/hello-world/HelloWorld.cfc +13 -0
- data/tracks/cfml/exercises/hello-world/HelloWorldTest.cfc +18 -0
- data/tracks/cfml/exercises/hello-world/Solution.cfc +13 -0
- data/tracks/cfml/exercises/hello-world/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/hello-world/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/hello-world/box.json +8 -0
- data/tracks/cfml/exercises/hello-world/index.cfm +37 -0
- data/tracks/cfml/exercises/isogram/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/isogram/Isogram.cfc +13 -0
- data/tracks/cfml/exercises/isogram/IsogramTest.cfc +55 -0
- data/tracks/cfml/exercises/isogram/Solution.cfc +23 -0
- data/tracks/cfml/exercises/isogram/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/isogram/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/isogram/box.json +8 -0
- data/tracks/cfml/exercises/isogram/index.cfm +37 -0
- data/tracks/cfml/exercises/largest-series-product/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/largest-series-product/LargestSeriesProduct.cfc +13 -0
- data/tracks/cfml/exercises/largest-series-product/LargestSeriesProductTest.cfc +75 -0
- data/tracks/cfml/exercises/largest-series-product/Solution.cfc +41 -0
- data/tracks/cfml/exercises/largest-series-product/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/largest-series-product/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/largest-series-product/box.json +8 -0
- data/tracks/cfml/exercises/largest-series-product/index.cfm +37 -0
- data/tracks/cfml/exercises/leap/Leap.cfc +15 -0
- data/tracks/cfml/exercises/leap/LeapTest.cfc +39 -0
- data/tracks/cfml/exercises/leap/README.md +33 -0
- data/tracks/cfml/exercises/leap/Solution.cfc +19 -0
- data/tracks/cfml/exercises/leap/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/leap/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/leap/box.json +8 -0
- data/tracks/cfml/exercises/leap/index.cfm +37 -0
- data/tracks/cfml/exercises/luhn/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/luhn/Luhn.cfc +13 -0
- data/tracks/cfml/exercises/luhn/LuhnTest.cfc +67 -0
- data/tracks/cfml/exercises/luhn/Solution.cfc +38 -0
- data/tracks/cfml/exercises/luhn/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/luhn/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/luhn/box.json +8 -0
- data/tracks/cfml/exercises/luhn/index.cfm +37 -0
- data/tracks/cfml/exercises/nth-prime/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/nth-prime/NthPrime.cfc +13 -0
- data/tracks/cfml/exercises/nth-prime/NthPrimeTest.cfc +35 -0
- data/tracks/cfml/exercises/nth-prime/Solution.cfc +33 -0
- data/tracks/cfml/exercises/nth-prime/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/nth-prime/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/nth-prime/box.json +8 -0
- data/tracks/cfml/exercises/nth-prime/index.cfm +37 -0
- data/tracks/cfml/exercises/pangram/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/pangram/Pangram.cfc +13 -0
- data/tracks/cfml/exercises/pangram/PangramTest.cfc +55 -0
- data/tracks/cfml/exercises/pangram/Solution.cfc +21 -0
- data/tracks/cfml/exercises/pangram/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/pangram/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/pangram/box.json +8 -0
- data/tracks/cfml/exercises/pangram/index.cfm +37 -0
- data/tracks/cfml/exercises/pig-latin/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/pig-latin/PigLatin.cfc +13 -0
- data/tracks/cfml/exercises/pig-latin/PigLatinTest.cfc +115 -0
- data/tracks/cfml/exercises/pig-latin/Solution.cfc +30 -0
- data/tracks/cfml/exercises/pig-latin/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/pig-latin/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/pig-latin/box.json +8 -0
- data/tracks/cfml/exercises/pig-latin/index.cfm +37 -0
- data/tracks/cfml/exercises/raindrops/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/raindrops/Raindrops.cfc +13 -0
- data/tracks/cfml/exercises/raindrops/RaindropsTest.cfc +87 -0
- data/tracks/cfml/exercises/raindrops/Solution.cfc +33 -0
- data/tracks/cfml/exercises/raindrops/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/raindrops/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/raindrops/box.json +8 -0
- data/tracks/cfml/exercises/raindrops/index.cfm +37 -0
- data/tracks/cfml/exercises/rna-transcription/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/rna-transcription/RnaTranscription.cfc +13 -0
- data/tracks/cfml/exercises/rna-transcription/RnaTranscriptionTest.cfc +47 -0
- data/tracks/cfml/exercises/rna-transcription/Solution.cfc +35 -0
- data/tracks/cfml/exercises/rna-transcription/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/rna-transcription/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/rna-transcription/box.json +8 -0
- data/tracks/cfml/exercises/rna-transcription/index.cfm +37 -0
- data/tracks/cfml/exercises/saddle-points/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/saddle-points/SaddlePoints.cfc +13 -0
- data/tracks/cfml/exercises/saddle-points/SaddlePointsTest.cfc +35 -0
- data/tracks/cfml/exercises/saddle-points/Solution.cfc +59 -0
- data/tracks/cfml/exercises/saddle-points/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/saddle-points/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/saddle-points/box.json +8 -0
- data/tracks/cfml/exercises/saddle-points/index.cfm +37 -0
- data/tracks/cfml/exercises/scrabble-score/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/scrabble-score/ScrabbleScore.cfc +13 -0
- data/tracks/cfml/exercises/scrabble-score/ScrabbleScoreTest.cfc +59 -0
- data/tracks/cfml/exercises/scrabble-score/Solution.cfc +50 -0
- data/tracks/cfml/exercises/scrabble-score/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/scrabble-score/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/scrabble-score/box.json +8 -0
- data/tracks/cfml/exercises/scrabble-score/index.cfm +37 -0
- data/tracks/cfml/exercises/secret-handshake/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/secret-handshake/SecretHandshake.cfc +13 -0
- data/tracks/cfml/exercises/secret-handshake/SecretHandshakeTest.cfc +63 -0
- data/tracks/cfml/exercises/secret-handshake/Solution.cfc +31 -0
- data/tracks/cfml/exercises/secret-handshake/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/secret-handshake/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/secret-handshake/box.json +8 -0
- data/tracks/cfml/exercises/secret-handshake/index.cfm +37 -0
- data/tracks/cfml/exercises/space-age/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/space-age/Solution.cfc +28 -0
- data/tracks/cfml/exercises/space-age/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/space-age/SpaceAge.cfc +13 -0
- data/tracks/cfml/exercises/space-age/SpaceAgeTest.cfc +47 -0
- data/tracks/cfml/exercises/space-age/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/space-age/box.json +8 -0
- data/tracks/cfml/exercises/space-age/index.cfm +37 -0
- data/tracks/cfml/exercises/sum-of-multiples/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/sum-of-multiples/Solution.cfc +27 -0
- data/tracks/cfml/exercises/sum-of-multiples/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/sum-of-multiples/SumOfMultiples.cfc +13 -0
- data/tracks/cfml/exercises/sum-of-multiples/SumOfMultiplesTest.cfc +63 -0
- data/tracks/cfml/exercises/sum-of-multiples/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/sum-of-multiples/box.json +8 -0
- data/tracks/cfml/exercises/sum-of-multiples/index.cfm +37 -0
- data/tracks/cfml/exercises/triangle/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/triangle/Solution.cfc +53 -0
- data/tracks/cfml/exercises/triangle/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/triangle/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/triangle/Triangle.cfc +18 -0
- data/tracks/cfml/exercises/triangle/TriangleTest.cfc +95 -0
- data/tracks/cfml/exercises/triangle/box.json +8 -0
- data/tracks/cfml/exercises/triangle/index.cfm +37 -0
- data/tracks/cfml/exercises/word-count/.meta/HINTS.md +0 -0
- data/tracks/cfml/exercises/word-count/Solution.cfc +22 -0
- data/tracks/cfml/exercises/word-count/SolutionTest.cfc +7 -0
- data/tracks/cfml/exercises/word-count/TestRunner.cfc +103 -0
- data/tracks/cfml/exercises/word-count/WordCount.cfc +13 -0
- data/tracks/cfml/exercises/word-count/WordCountTest.cfc +55 -0
- data/tracks/cfml/exercises/word-count/box.json +8 -0
- data/tracks/cfml/exercises/word-count/index.cfm +37 -0
- data/tracks/cfml/img/icon.png +0 -0
- data/tracks/cfml/tasks/GenerateTests.cfc +179 -0
- data/tracks/cfml/tasks/ScaffoldExercise.cfc +85 -0
- data/tracks/cfml/tasks/TestAllSolutions.cfc +24 -0
- data/tracks/cfml/tasks/exercise_template/.meta/HINTS.md +0 -0
- data/tracks/cfml/tasks/exercise_template/@@name@@.cfc +13 -0
- data/tracks/cfml/tasks/exercise_template/@@name@@Test.cfc +15 -0
- data/tracks/cfml/tasks/exercise_template/Solution.cfc +6 -0
- data/tracks/cfml/tasks/exercise_template/SolutionTest.cfc +7 -0
- data/tracks/cfml/tasks/exercise_template/TestRunner.cfc +103 -0
- data/tracks/cfml/tasks/exercise_template/box.json +8 -0
- data/tracks/cfml/tasks/exercise_template/index.cfm +37 -0
- data/tracks/coldfusion/docs/ABOUT.md +8 -6
- data/tracks/csharp/docs/GENERATORS.md +7 -0
- data/tracks/csharp/exercises/clock/ClockTest.cs +15 -15
- data/tracks/csharp/exercises/nucleotide-count/Example.cs +10 -11
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCount.cs +2 -7
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCountTest.cs +37 -47
- data/tracks/csharp/exercises/pig-latin/Example.cs +1 -1
- data/tracks/csharp/exercises/pig-latin/PigLatinTest.cs +19 -7
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiplesTest.cs +7 -1
- data/tracks/csharp/exercises/tournament/Example.cs +1 -1
- data/tracks/csharp/exercises/tournament/TournamentTest.cs +151 -68
- data/tracks/csharp/exercises/triangle/Example.cs +26 -8
- data/tracks/csharp/exercises/triangle/Triangle.cs +16 -1
- data/tracks/csharp/exercises/triangle/TriangleTest.cs +44 -30
- data/tracks/csharp/generators/Exercise.cs +6 -1
- data/tracks/csharp/generators/Exercises/Clock.cs +17 -1
- data/tracks/csharp/generators/Exercises/NucleotideCount.cs +61 -0
- data/tracks/csharp/generators/Exercises/Tournament.cs +66 -0
- data/tracks/csharp/generators/Exercises/Triangle.cs +36 -0
- data/tracks/dart/config.json +15 -2
- data/tracks/dart/exercises/raindrops/lib/example.dart +23 -0
- data/tracks/dart/exercises/raindrops/lib/raindrops.dart +3 -0
- data/tracks/dart/exercises/raindrops/pubspec.lock +281 -0
- data/tracks/dart/exercises/raindrops/pubspec.yaml +3 -0
- data/tracks/dart/exercises/raindrops/test/raindrops_test.dart +94 -0
- data/tracks/delphi/exercises/pig-latin/uPigLatinExample.pas +1 -25
- data/tracks/haskell/config.json +9 -0
- data/tracks/haskell/exercises/acronym/README.md +0 -1
- data/tracks/haskell/exercises/all-your-base/README.md +1 -1
- data/tracks/haskell/exercises/allergies/README.md +0 -1
- data/tracks/haskell/exercises/alphametics/README.md +2 -2
- data/tracks/haskell/exercises/atbash-cipher/README.md +2 -1
- data/tracks/haskell/exercises/beer-song/README.md +1 -1
- data/tracks/haskell/exercises/binary/README.md +2 -0
- data/tracks/haskell/exercises/bowling/README.md +20 -6
- data/tracks/haskell/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/haskell/exercises/connect/README.md +1 -1
- data/tracks/haskell/exercises/crypto-square/README.md +4 -4
- data/tracks/haskell/exercises/diamond/README.md +113 -0
- data/tracks/haskell/exercises/diamond/examples/success-standard/package.yaml +16 -0
- data/tracks/haskell/exercises/diamond/examples/success-standard/src/Diamond.hs +16 -0
- data/tracks/haskell/exercises/diamond/package.yaml +20 -0
- data/tracks/haskell/exercises/diamond/src/Diamond.hs +4 -0
- data/tracks/haskell/exercises/diamond/stack.yaml +1 -0
- data/tracks/haskell/exercises/diamond/test/Tests.hs +109 -0
- data/tracks/haskell/exercises/etl/README.md +3 -1
- data/tracks/haskell/exercises/food-chain/README.md +1 -1
- data/tracks/haskell/exercises/go-counting/README.md +1 -1
- data/tracks/haskell/exercises/grade-school/README.md +0 -1
- data/tracks/haskell/exercises/grains/README.md +0 -1
- data/tracks/haskell/exercises/house/README.md +1 -2
- data/tracks/haskell/exercises/isogram/README.md +2 -1
- data/tracks/haskell/exercises/kindergarten-garden/README.md +3 -3
- data/tracks/haskell/exercises/leap/README.md +1 -1
- data/tracks/haskell/exercises/linked-list/README.md +10 -10
- data/tracks/haskell/exercises/luhn/README.md +7 -7
- data/tracks/haskell/exercises/matrix/README.md +6 -4
- data/tracks/haskell/exercises/meetup/README.md +1 -2
- data/tracks/haskell/exercises/nucleotide-count/README.md +8 -22
- data/tracks/haskell/exercises/ocr-numbers/README.md +6 -6
- data/tracks/haskell/exercises/octal/README.md +6 -2
- data/tracks/haskell/exercises/palindrome-products/README.md +12 -6
- data/tracks/haskell/exercises/pangram/README.md +1 -1
- data/tracks/haskell/exercises/pascals-triangle/README.md +2 -2
- data/tracks/haskell/exercises/phone-number/README.md +3 -2
- data/tracks/haskell/exercises/pov/README.md +3 -3
- data/tracks/haskell/exercises/pythagorean-triplet/README.md +3 -3
- data/tracks/haskell/exercises/queen-attack/README.md +1 -1
- data/tracks/haskell/exercises/rna-transcription/README.md +1 -1
- data/tracks/haskell/exercises/roman-numerals/README.md +1 -1
- data/tracks/haskell/exercises/run-length-encoding/README.md +4 -4
- data/tracks/haskell/exercises/saddle-points/README.md +1 -1
- data/tracks/haskell/exercises/scrabble-score/README.md +3 -1
- data/tracks/haskell/exercises/secret-handshake/README.md +1 -1
- data/tracks/haskell/exercises/sgf-parsing/README.md +4 -4
- data/tracks/haskell/exercises/simple-cipher/README.md +1 -1
- data/tracks/haskell/exercises/spiral-matrix/README.md +2 -2
- data/tracks/haskell/exercises/triangle/README.md +9 -6
- data/tracks/haskell/exercises/trinary/README.md +1 -1
- data/tracks/haskell/exercises/word-count/README.md +1 -2
- data/tracks/haskell/exercises/wordy/README.md +0 -5
- data/tracks/java/config.json +56 -9
- data/tracks/java/exercises/binary-search-tree/src/test/java/BSTTest.java +4 -4
- data/tracks/javascript/exercises/two-bucket/example.js +66 -69
- data/tracks/javascript/exercises/two-bucket/two-bucket.spec.js +18 -18
- data/tracks/julia/config.json +1 -0
- data/tracks/julia/docs/ABOUT.md +3 -8
- data/tracks/prolog/README.md +1 -1
- data/tracks/purescript/.travis.yml +1 -0
- data/tracks/purescript/README.md +9 -0
- data/tracks/purescript/bin/check-bower.sh +42 -0
- data/tracks/purescript/bin/test-separate.sh +46 -0
- data/tracks/python/README.md +2 -2
- data/tracks/python/exercises/all-your-base/all_your_base.py +2 -0
- data/tracks/python/exercises/atbash-cipher/atbash_cipher.py +2 -2
- data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +2 -2
- data/tracks/python/exercises/complex-numbers/example.py +2 -2
- data/tracks/python/exercises/gigasecond/gigasecond.py +1 -1
- data/tracks/python/exercises/hamming/hamming.py +1 -1
- data/tracks/python/exercises/hexadecimal/hexadecimal.py +1 -1
- data/tracks/python/exercises/leap/leap.py +1 -1
- data/tracks/python/exercises/meetup/meetup.py +1 -1
- data/tracks/python/exercises/phone-number/example.py +4 -2
- data/tracks/python/exercises/phone-number/phone_number_test.py +47 -16
- data/tracks/python/exercises/pig-latin/pig_latin.py +1 -1
- data/tracks/python/exercises/scrabble-score/scrabble_score.py +1 -1
- data/tracks/python/exercises/wordy/wordy.py +1 -1
- data/tracks/scala/exercises/meetup/example.scala +29 -10
- data/tracks/scala/exercises/meetup/src/main/scala/Meetup.scala +23 -0
- data/tracks/scala/exercises/meetup/src/test/scala/MeetupTest.scala +273 -183
- data/tracks/sml/config.json +13 -0
- data/tracks/sml/exercises/anagram/README.md +21 -5
- data/tracks/sml/exercises/anagram/anagram.sml +2 -6
- data/tracks/sml/exercises/anagram/example.sml +29 -24
- data/tracks/sml/exercises/anagram/test.sml +56 -50
- data/tracks/sml/exercises/anagram/testlib.sml +159 -0
- data/tracks/sml/exercises/diamond/README.md +89 -0
- data/tracks/sml/exercises/diamond/diamond.sml +2 -0
- data/tracks/sml/exercises/diamond/example.sml +25 -0
- data/tracks/sml/exercises/diamond/test.sml +27 -0
- data/tracks/sml/exercises/diamond/testlib.sml +159 -0
- data/tracks/sml/exercises/raindrops/raindrops.sml +2 -2
- data/tracks/sml/exercises/raindrops/test.sml +66 -95
- data/tracks/sml/exercises/raindrops/testlib.sml +159 -0
- metadata +265 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## Installation
|
|
2
|
+
|
|
3
|
+
The only thing you will need to run these exercises is [CommandBox CLI](https://ortus.gitbooks.io/commandbox-documentation/content/getting_started_guide.html) and [Java 7+](https://java.com/en/download/) installed. CommandBox CLI is supported on Mac, Linux, and Windows, and the installation guide can be found here:
|
|
4
|
+
|
|
5
|
+
[https://ortus.gitbooks.io/commandbox-documentation/content/setup/installation.html](https://ortus.gitbooks.io/commandbox-documentation/content/setup/installation.html)
|
|
6
|
+
|
|
7
|
+
An example of getting CommandBox CLI setup if you're a Homebrew user on Mac would be:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
brew install commandbox
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Once you have the CLI installed, you can play withe REPL:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
box repl
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You can directly execute .cfm pages:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
box exec myTest.cfm
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
And you can even start up a web server in any directory of your hard drive:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
box server start
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
CommandBox has an interactive shell you can use that has enhanced tab completion and runs faster. Enter it by just running the `box` binary with no arguments.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
box
|
|
35
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
## Recommended Learning Resources
|
|
2
|
+
|
|
3
|
+
Welcome to learning ColdFusion (CFML)! CFML is a dynamic and loosely typed JVM scripting language. It has two different file types. `.cfm` files (ColdFusion markup)_ are purely procedural and use the tag-based syntax for templating out HTML. You would use these for views if building a web site:
|
|
4
|
+
|
|
5
|
+
**index.cfm**
|
|
6
|
+
|
|
7
|
+
```xml
|
|
8
|
+
<cfoutput>
|
|
9
|
+
<html>
|
|
10
|
+
<h1>Welcome to my site, #FirstName# #LastName#!
|
|
11
|
+
</html>
|
|
12
|
+
</cfoutput>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The other type of file is the `.cfc` (ColdFusion Component) and it is how you declare a class. Components are used for business logic, models, and controllers. These usually use the script syntax, which reads similar to JavaScript.
|
|
16
|
+
|
|
17
|
+
**Car.cfc**
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
component accessors=true {
|
|
21
|
+
property name='make' type='string';
|
|
22
|
+
property name='model' type='string';
|
|
23
|
+
property name='year' type='number';
|
|
24
|
+
|
|
25
|
+
function init() {
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Here are some guides for learning more about CFML
|
|
33
|
+
|
|
34
|
+
* [Modern ColdFusion (CFML) in 100 Minutes](https://www.gitbook.com/book/ortus/modern-coldfusion-cfml-in-100-minutes/details)
|
|
35
|
+
* [CF SCript Cheatsheet](http://www.petefreitag.com/cheatsheets/coldfusion/cfscript/)
|
|
36
|
+
* [Learn CF In A Week](http://www.learncfinaweek.com/)
|
|
37
|
+
* [CommandBox CLI Getting Started Guide](https://ortus.gitbooks.io/commandbox-documentation/content/getting_started_guide.html)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## Recommended Resources
|
|
2
|
+
|
|
3
|
+
### Learning
|
|
4
|
+
* [Modern ColdFusion (CFML) in 100 Minutes](https://www.gitbook.com/book/ortus/modern-coldfusion-cfml-in-100-minutes/details)
|
|
5
|
+
* [CF SCript Cheatsheet](http://www.petefreitag.com/cheatsheets/coldfusion/cfscript/)
|
|
6
|
+
* [Learn CF In A Week](http://www.learncfinaweek.com/)
|
|
7
|
+
|
|
8
|
+
### CF Engines
|
|
9
|
+
|
|
10
|
+
* [Lucee Server](http://lucee.org/) - A free open source CFML engine
|
|
11
|
+
* [Adobe ColdFusion](http://www.adobe.com/products/coldfusion-family.html) - A commercially supported Enterprise CF engine
|
|
12
|
+
|
|
13
|
+
### Online Communities
|
|
14
|
+
|
|
15
|
+
* [CFML Slack](https://cfml-slack.herokuapp.com/)
|
|
16
|
+
* [Stack Overflow](https://stackoverflow.com/questions/tagged/coldfusion)
|
|
17
|
+
* [Community Resource Page](http://carehart.org/cf411/)
|
|
18
|
+
* [Lucee Server Discourse Forum](https://dev.lucee.org/)
|
|
19
|
+
* [Twitter](https://twitter.com/search?q=coldfusion&src=typd)
|
|
20
|
+
|
|
21
|
+
### Tools
|
|
22
|
+
|
|
23
|
+
* [CF Docs](https://cfdocs.org/)
|
|
24
|
+
* [Try CF](https://www.trycf.com/)
|
|
25
|
+
* [ColdBox MVC](https://coldbox.ortusbooks.com/content/full/getting_started_guide/)
|
|
26
|
+
* [CFWheels MVC](https://cfwheels.org/)
|
|
27
|
+
* [FW/1 MVC](http://framework-one.github.io/documentation/)
|
|
28
|
+
* [CommandBox CLI](https://ortus.gitbooks.io/commandbox-documentation/content/getting_started_guide.html)
|
|
29
|
+
* [ForgeBox Package repo](https://www.forgebox.io/)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
## Running Tests
|
|
2
|
+
|
|
3
|
+
To run the test for a given exercise, `cd` into the folder and run the following:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
box task run TestRunner
|
|
7
|
+
# Or start up a test watcher that will rerun when files change
|
|
8
|
+
box task run TestRunner --:watcher
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The tests leverage a library called TestBox which supports xUnit and BDD style of testing. All test suites will be written in the [BDD style](https://testbox.ortusbooks.com/content/primers/bdd/specs.html) which uses closures to define test specs. You won't need to worry about installing TestBox. The CLI test runner will take care of that for you. You just need to be connected to the internet the first time you run it. You can read more about it here:
|
|
12
|
+
|
|
13
|
+
[https://testbox.ortusbooks.com/content/](https://testbox.ortusbooks.com/content/)
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
component extends="testbox.system.BaseSpec" {
|
|
2
|
+
|
|
3
|
+
function beforeAll(){
|
|
4
|
+
SUT = createObject( 'Acronym' );
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function run(){
|
|
8
|
+
|
|
9
|
+
describe( "My Acronym class", function(){
|
|
10
|
+
|
|
11
|
+
describe( 'Abbreviate a phrase', function(){
|
|
12
|
+
|
|
13
|
+
it( 'basic', function(){
|
|
14
|
+
expect( SUT.abbreviate( phrase='Portable Network Graphics' ) ).toBe( 'PNG' );
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it( 'lowercase words', function(){
|
|
18
|
+
expect( SUT.abbreviate( phrase='Ruby on Rails' ) ).toBe( 'ROR' );
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it( 'punctuation', function(){
|
|
22
|
+
expect( SUT.abbreviate( phrase='First In, First Out' ) ).toBe( 'FIFO' );
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it( 'all caps words', function(){
|
|
26
|
+
expect( SUT.abbreviate( phrase='PHP: Hypertext Preprocessor' ) ).toBe( 'PHP' );
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it( 'non-acronym all caps word', function(){
|
|
30
|
+
expect( SUT.abbreviate( phrase='GNU Image Manipulation Program' ) ).toBe( 'GIMP' );
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it( 'hyphenated', function(){
|
|
34
|
+
expect( SUT.abbreviate( phrase='Complementary metal-oxide semiconductor' ) ).toBe( 'CMOS' );
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Here is an example solution for the Acronym exercise
|
|
3
|
+
*/
|
|
4
|
+
component {
|
|
5
|
+
|
|
6
|
+
function abbreviate( phrase ) {
|
|
7
|
+
|
|
8
|
+
return phrase
|
|
9
|
+
// Break up string on spaces or hyphens
|
|
10
|
+
.listToArray( ' -' )
|
|
11
|
+
// Strip first char of each word
|
|
12
|
+
.map( function( word ) {
|
|
13
|
+
return word.left( 1 );
|
|
14
|
+
} )
|
|
15
|
+
// Concat back to string
|
|
16
|
+
.toList( '' )
|
|
17
|
+
// Upper case for good measure
|
|
18
|
+
.uCase();
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I am a CommandBox task runner which you can use to test your implementation of this exercise against the
|
|
3
|
+
* provided test suite. To use me, open the CommandBox CLI and run this:
|
|
4
|
+
*
|
|
5
|
+
* CommandBox> task run TestRunner
|
|
6
|
+
*
|
|
7
|
+
* To start up a test watcher that will automatically rerun the test suite every time you save a file change, run this:
|
|
8
|
+
*
|
|
9
|
+
* CommandBox> task run TestRunner --watcher
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
component {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @solution Runs the tests against the solution
|
|
16
|
+
* @watcher Start up a file watch that re-runs the tests on file changes. Use Ctrl-C to stop
|
|
17
|
+
*/
|
|
18
|
+
function run( boolean solution=false, boolean watcher=false ) {
|
|
19
|
+
|
|
20
|
+
ensureTestBox();
|
|
21
|
+
|
|
22
|
+
if( watcher ) {
|
|
23
|
+
|
|
24
|
+
// Tabula rasa
|
|
25
|
+
command( 'cls' ).run();
|
|
26
|
+
|
|
27
|
+
// Start watcher
|
|
28
|
+
watch()
|
|
29
|
+
.paths( '*.cfc' )
|
|
30
|
+
.inDirectory( getCWD() )
|
|
31
|
+
.withDelay( 500 )
|
|
32
|
+
.onChange( function() {
|
|
33
|
+
|
|
34
|
+
// Clear the screen
|
|
35
|
+
command( 'cls' )
|
|
36
|
+
.run();
|
|
37
|
+
|
|
38
|
+
// This is neccessary so changes to tests get picked up right away.
|
|
39
|
+
pagePoolClear();
|
|
40
|
+
|
|
41
|
+
runTests( solution );
|
|
42
|
+
|
|
43
|
+
} )
|
|
44
|
+
.start();
|
|
45
|
+
|
|
46
|
+
} else {
|
|
47
|
+
runTests( solution );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Make sure the TestBox framework is installed
|
|
54
|
+
*/
|
|
55
|
+
private function ensureTestBox() {
|
|
56
|
+
var excerciseRoot = getCWD();
|
|
57
|
+
var testBoxRoot = excerciseRoot & '/testbox';
|
|
58
|
+
|
|
59
|
+
if( !directoryExists( testBoxRoot ) ) {
|
|
60
|
+
|
|
61
|
+
print.boldYellowLine( 'Installing some missing dependencies for you!' ).toConsole();
|
|
62
|
+
command( 'install' )
|
|
63
|
+
.inWorkingDirectory( excerciseRoot )
|
|
64
|
+
.run();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Bootstrap TestBox framework
|
|
68
|
+
filesystemUtil.createMapping( '/testbox', testBoxRoot );
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Invoke TestBox to run the test suite
|
|
73
|
+
*/
|
|
74
|
+
private function runTests( boolean solution=false ) {
|
|
75
|
+
|
|
76
|
+
// Create TestBox and run the tests
|
|
77
|
+
testData = new testbox.system.TestBox()
|
|
78
|
+
.runRaw( directory = {
|
|
79
|
+
// Find all CFCs...
|
|
80
|
+
mapping = filesystemUtil.makePathRelative( getCWD() ),
|
|
81
|
+
// ... in this directory ...
|
|
82
|
+
recurse = false,
|
|
83
|
+
// ... whose name ends in "test"
|
|
84
|
+
filter = function( path ) {
|
|
85
|
+
return path.reFind( ( solution ? 'Solution' : '' ) & 'Test.cfc$' );
|
|
86
|
+
}
|
|
87
|
+
} )
|
|
88
|
+
.getMemento();
|
|
89
|
+
|
|
90
|
+
// Print out the results with ANSI formatting for the CLI
|
|
91
|
+
getInstance( 'CLIRenderer@testbox-commands' )
|
|
92
|
+
.render( print, testData, true );
|
|
93
|
+
|
|
94
|
+
print.toConsole();
|
|
95
|
+
|
|
96
|
+
// Set proper exit code
|
|
97
|
+
if( testData.totalFail || testData.totalError ) {
|
|
98
|
+
setExitCode( 1 );
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
|
|
3
|
+
This file will only be used if you want to start up a web server in this directory. You can do so by running:
|
|
4
|
+
|
|
5
|
+
$> box
|
|
6
|
+
CommandBox> install
|
|
7
|
+
CommandBox> server start
|
|
8
|
+
|
|
9
|
+
However, this is not necessary unless you really just want to use the HTML reporters on TestBox.
|
|
10
|
+
Ideally, you'll skip the need for this file entirely and just run the tests directly frm the CLI like this:
|
|
11
|
+
|
|
12
|
+
CommandBox> task run TestRunner
|
|
13
|
+
|
|
14
|
+
--->
|
|
15
|
+
<cfsetting showDebugOutput="false">
|
|
16
|
+
<cfparam name="url.reporter" default="simple">
|
|
17
|
+
<cfscript>
|
|
18
|
+
// get a list of all CFCs in this folder whose name looks like "XXXTest.cfc"
|
|
19
|
+
// And turn it into compnent path relative to the web root
|
|
20
|
+
url.bundles = directoryList(
|
|
21
|
+
path=expandPath( '/' ),
|
|
22
|
+
filter='*Test.cfc' )
|
|
23
|
+
.map( function( path ) {
|
|
24
|
+
return path
|
|
25
|
+
.replaceNoCase( expandPath( '/' ), '' )
|
|
26
|
+
.left( -4 )
|
|
27
|
+
} )
|
|
28
|
+
.toList();
|
|
29
|
+
</cfscript>
|
|
30
|
+
|
|
31
|
+
<!--- Ensure TestBox --->
|
|
32
|
+
<cfif fileExists( "/testbox/system/runners/HTMLRunner.cfm" )>
|
|
33
|
+
<!--- Include the TestBox HTML Runner --->
|
|
34
|
+
<cfinclude template="/testbox/system/runners/HTMLRunner.cfm">
|
|
35
|
+
<cfelse>
|
|
36
|
+
Oops, you don't have TestBox installed yet! Please run <b>box install</b> from the root of your excercise folder and refresh this page.
|
|
37
|
+
</cfif>
|
|
File without changes
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
component extends="testbox.system.BaseSpec" {
|
|
2
|
+
|
|
3
|
+
function beforeAll(){
|
|
4
|
+
SUT = createObject( 'AtbashCipher' );
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function run(){
|
|
8
|
+
|
|
9
|
+
describe( "My AtbashCipher class", function(){
|
|
10
|
+
|
|
11
|
+
describe( 'encode', function(){
|
|
12
|
+
|
|
13
|
+
it( 'encode yes', function(){
|
|
14
|
+
expect( SUT.encode( phrase='yes' ) ).toBe( 'bvh' );
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it( 'encode no', function(){
|
|
18
|
+
expect( SUT.encode( phrase='no' ) ).toBe( 'ml' );
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it( 'encode OMG', function(){
|
|
22
|
+
expect( SUT.encode( phrase='OMG' ) ).toBe( 'lnt' );
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it( 'encode spaces', function(){
|
|
26
|
+
expect( SUT.encode( phrase='O M G' ) ).toBe( 'lnt' );
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it( 'encode mindblowingly', function(){
|
|
30
|
+
expect( SUT.encode( phrase='mindblowingly' ) ).toBe( 'nrmwy oldrm tob' );
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it( 'encode numbers', function(){
|
|
34
|
+
expect( SUT.encode( phrase='Testing, 1 2 3, testing.' ) ).toBe( 'gvhgr mt123 gvhgr mt' );
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it( 'encode deep thought', function(){
|
|
38
|
+
expect( SUT.encode( phrase='Truth is fiction.' ) ).toBe( 'gifgs rhurx grlm' );
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it( 'encode all the letters', function(){
|
|
42
|
+
expect( SUT.encode( phrase='The quick brown fox jumps over the lazy dog.' ) ).toBe( 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' );
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe( 'decode', function(){
|
|
48
|
+
|
|
49
|
+
it( 'decode exercism', function(){
|
|
50
|
+
expect( SUT.decode( phrase='vcvix rhn' ) ).toBe( 'exercism' );
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it( 'decode a sentence', function(){
|
|
54
|
+
expect( SUT.decode( phrase='zmlyh gzxov rhlug vmzhg vkkrm thglm v' ) ).toBe( 'anobstacleisoftenasteppingstone' );
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it( 'decode numbers', function(){
|
|
58
|
+
expect( SUT.decode( phrase='gvhgr mt123 gvhgr mt' ) ).toBe( 'testing123testing' );
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it( 'decode all the letters', function(){
|
|
62
|
+
expect( SUT.decode( phrase='gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' ) ).toBe( 'thequickbrownfoxjumpsoverthelazydog' );
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Here is an example solution for the AtbashCipher exercise
|
|
3
|
+
*/
|
|
4
|
+
component {
|
|
5
|
+
|
|
6
|
+
function encode( phrase ) {
|
|
7
|
+
var result = '';
|
|
8
|
+
var breakCounter = 0;
|
|
9
|
+
|
|
10
|
+
phrase
|
|
11
|
+
.lcase()
|
|
12
|
+
// Clean anything not alphanumeric
|
|
13
|
+
.reReplace( '[^0-9a-z]', '', 'all' )
|
|
14
|
+
.listToArray( '' )
|
|
15
|
+
// Loop over each char
|
|
16
|
+
.each( function( char ) {
|
|
17
|
+
breakCounter++;
|
|
18
|
+
result &= invertChar( char );
|
|
19
|
+
// Every 5th char gets a space
|
|
20
|
+
if( breakCounter % 5 == 0 ) {
|
|
21
|
+
result &= ' ';
|
|
22
|
+
}
|
|
23
|
+
} );
|
|
24
|
+
|
|
25
|
+
// Nuke trailing spaces
|
|
26
|
+
return result.trim();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function decode( phrase ) {
|
|
30
|
+
var result = '';
|
|
31
|
+
|
|
32
|
+
phrase
|
|
33
|
+
.lcase()
|
|
34
|
+
// Clean anything not alphanumeric
|
|
35
|
+
.reReplace( '[^0-9a-z]', '', 'all' )
|
|
36
|
+
.listToArray( '' )
|
|
37
|
+
// Loop over each char
|
|
38
|
+
.each( function( char ) {
|
|
39
|
+
result &= invertChar( char );
|
|
40
|
+
} );
|
|
41
|
+
|
|
42
|
+
return result;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
private function invertChar( char ) {
|
|
46
|
+
// Pass numbers straight through
|
|
47
|
+
if( asc( char ) >= 49 && asc( char ) <= 57 ) {
|
|
48
|
+
return char;
|
|
49
|
+
} else {
|
|
50
|
+
// For letters, find the offset from "a" and reverse it from "z"
|
|
51
|
+
// Using the ascii codes as a handy reference intead of creating an array of chars
|
|
52
|
+
return chr( 122 - ( asc( char ) - 97 ) );
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* I am a CommandBox task runner which you can use to test your implementation of this exercise against the
|
|
3
|
+
* provided test suite. To use me, open the CommandBox CLI and run this:
|
|
4
|
+
*
|
|
5
|
+
* CommandBox> task run TestRunner
|
|
6
|
+
*
|
|
7
|
+
* To start up a test watcher that will automatically rerun the test suite every time you save a file change, run this:
|
|
8
|
+
*
|
|
9
|
+
* CommandBox> task run TestRunner --watcher
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
component {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @solution Runs the tests against the solution
|
|
16
|
+
* @watcher Start up a file watch that re-runs the tests on file changes. Use Ctrl-C to stop
|
|
17
|
+
*/
|
|
18
|
+
function run( boolean solution=false, boolean watcher=false ) {
|
|
19
|
+
|
|
20
|
+
ensureTestBox();
|
|
21
|
+
|
|
22
|
+
if( watcher ) {
|
|
23
|
+
|
|
24
|
+
// Tabula rasa
|
|
25
|
+
command( 'cls' ).run();
|
|
26
|
+
|
|
27
|
+
// Start watcher
|
|
28
|
+
watch()
|
|
29
|
+
.paths( '*.cfc' )
|
|
30
|
+
.inDirectory( getCWD() )
|
|
31
|
+
.withDelay( 500 )
|
|
32
|
+
.onChange( function() {
|
|
33
|
+
|
|
34
|
+
// Clear the screen
|
|
35
|
+
command( 'cls' )
|
|
36
|
+
.run();
|
|
37
|
+
|
|
38
|
+
// This is neccessary so changes to tests get picked up right away.
|
|
39
|
+
pagePoolClear();
|
|
40
|
+
|
|
41
|
+
runTests( solution );
|
|
42
|
+
|
|
43
|
+
} )
|
|
44
|
+
.start();
|
|
45
|
+
|
|
46
|
+
} else {
|
|
47
|
+
runTests( solution );
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Make sure the TestBox framework is installed
|
|
54
|
+
*/
|
|
55
|
+
private function ensureTestBox() {
|
|
56
|
+
var excerciseRoot = getCWD();
|
|
57
|
+
var testBoxRoot = excerciseRoot & '/testbox';
|
|
58
|
+
|
|
59
|
+
if( !directoryExists( testBoxRoot ) ) {
|
|
60
|
+
|
|
61
|
+
print.boldYellowLine( 'Installing some missing dependencies for you!' ).toConsole();
|
|
62
|
+
command( 'install' )
|
|
63
|
+
.inWorkingDirectory( excerciseRoot )
|
|
64
|
+
.run();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Bootstrap TestBox framework
|
|
68
|
+
filesystemUtil.createMapping( '/testbox', testBoxRoot );
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Invoke TestBox to run the test suite
|
|
73
|
+
*/
|
|
74
|
+
private function runTests( boolean solution=false ) {
|
|
75
|
+
|
|
76
|
+
// Create TestBox and run the tests
|
|
77
|
+
testData = new testbox.system.TestBox()
|
|
78
|
+
.runRaw( directory = {
|
|
79
|
+
// Find all CFCs...
|
|
80
|
+
mapping = filesystemUtil.makePathRelative( getCWD() ),
|
|
81
|
+
// ... in this directory ...
|
|
82
|
+
recurse = false,
|
|
83
|
+
// ... whose name ends in "test"
|
|
84
|
+
filter = function( path ) {
|
|
85
|
+
return path.reFind( ( solution ? 'Solution' : '' ) & 'Test.cfc$' );
|
|
86
|
+
}
|
|
87
|
+
} )
|
|
88
|
+
.getMemento();
|
|
89
|
+
|
|
90
|
+
// Print out the results with ANSI formatting for the CLI
|
|
91
|
+
getInstance( 'CLIRenderer@testbox-commands' )
|
|
92
|
+
.render( print, testData, true );
|
|
93
|
+
|
|
94
|
+
print.toConsole();
|
|
95
|
+
|
|
96
|
+
// Set proper exit code
|
|
97
|
+
if( testData.totalFail || testData.totalError ) {
|
|
98
|
+
setExitCode( 1 );
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!---
|
|
2
|
+
|
|
3
|
+
This file will only be used if you want to start up a web server in this directory. You can do so by running:
|
|
4
|
+
|
|
5
|
+
$> box
|
|
6
|
+
CommandBox> install
|
|
7
|
+
CommandBox> server start
|
|
8
|
+
|
|
9
|
+
However, this is not necessary unless you really just want to use the HTML reporters on TestBox.
|
|
10
|
+
Ideally, you'll skip the need for this file entirely and just run the tests directly frm the CLI like this:
|
|
11
|
+
|
|
12
|
+
CommandBox> task run TestRunner
|
|
13
|
+
|
|
14
|
+
--->
|
|
15
|
+
<cfsetting showDebugOutput="false">
|
|
16
|
+
<cfparam name="url.reporter" default="simple">
|
|
17
|
+
<cfscript>
|
|
18
|
+
// get a list of all CFCs in this folder whose name looks like "XXXTest.cfc"
|
|
19
|
+
// And turn it into compnent path relative to the web root
|
|
20
|
+
url.bundles = directoryList(
|
|
21
|
+
path=expandPath( '/' ),
|
|
22
|
+
filter='*Test.cfc' )
|
|
23
|
+
.map( function( path ) {
|
|
24
|
+
return path
|
|
25
|
+
.replaceNoCase( expandPath( '/' ), '' )
|
|
26
|
+
.left( -4 )
|
|
27
|
+
} )
|
|
28
|
+
.toList();
|
|
29
|
+
</cfscript>
|
|
30
|
+
|
|
31
|
+
<!--- Ensure TestBox --->
|
|
32
|
+
<cfif fileExists( "/testbox/system/runners/HTMLRunner.cfm" )>
|
|
33
|
+
<!--- Include the TestBox HTML Runner --->
|
|
34
|
+
<cfinclude template="/testbox/system/runners/HTMLRunner.cfm">
|
|
35
|
+
<cfelse>
|
|
36
|
+
Oops, you don't have TestBox installed yet! Please run <b>box install</b> from the root of your excercise folder and refresh this page.
|
|
37
|
+
</cfif>
|
|
File without changes
|