trackler 2.2.1.44 → 2.2.1.45
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/isbn-verifier/canonical-data.json +88 -0
- data/problem-specifications/exercises/isbn-verifier/description.md +35 -0
- data/problem-specifications/exercises/isbn-verifier/metadata.yml +4 -0
- data/problem-specifications/exercises/robot-simulator/canonical-data.json +125 -32
- data/problem-specifications/exercises/sum-of-multiples/description.md +0 -3
- data/problem-specifications/exercises/two-bucket/canonical-data.json +3 -3
- data/tracks/c/config.json +235 -237
- data/tracks/c/exercises/acronym/README.md +0 -1
- data/tracks/c/exercises/all-your-base/README.md +1 -1
- data/tracks/c/exercises/allergies/README.md +0 -1
- data/tracks/c/exercises/atbash-cipher/README.md +2 -1
- data/tracks/c/exercises/beer-song/README.md +1 -1
- data/tracks/c/exercises/binary/README.md +2 -0
- data/tracks/c/exercises/grains/README.md +0 -1
- data/tracks/c/exercises/isogram/README.md +2 -1
- data/tracks/c/exercises/leap/README.md +1 -1
- data/tracks/c/exercises/meetup/README.md +1 -2
- data/tracks/c/exercises/nucleotide-count/README.md +8 -22
- data/tracks/c/exercises/palindrome-products/README.md +12 -6
- data/tracks/c/exercises/pangram/README.md +1 -1
- data/tracks/c/exercises/pascals-triangle/README.md +1 -1
- data/tracks/c/exercises/perfect-numbers/README.md +2 -2
- data/tracks/c/exercises/phone-number/README.md +3 -2
- data/tracks/c/exercises/roman-numerals/README.md +1 -1
- data/tracks/c/exercises/scrabble-score/README.md +3 -1
- data/tracks/c/exercises/space-age/README.md +2 -1
- data/tracks/c/exercises/triangle/README.md +9 -6
- data/tracks/c/exercises/word-count/README.md +1 -2
- data/tracks/csharp/exercises/accumulate/Accumulate.csproj +2 -2
- data/tracks/csharp/exercises/acronym/Acronym.csproj +2 -2
- data/tracks/csharp/exercises/all-your-base/AllYourBase.csproj +2 -2
- data/tracks/csharp/exercises/allergies/Allergies.csproj +2 -2
- data/tracks/csharp/exercises/alphametics/Alphametics.csproj +2 -2
- data/tracks/csharp/exercises/anagram/Anagram.csproj +2 -2
- data/tracks/csharp/exercises/atbash-cipher/AtbashCipher.csproj +2 -2
- data/tracks/csharp/exercises/bank-account/BankAccount.csproj +2 -2
- data/tracks/csharp/exercises/beer-song/BeerSong.csproj +2 -2
- data/tracks/csharp/exercises/binary-search/BinarySearch.csproj +2 -2
- data/tracks/csharp/exercises/binary-search-tree/BinarySearchTree.csproj +2 -2
- data/tracks/csharp/exercises/bob/Bob.csproj +2 -2
- data/tracks/csharp/exercises/book-store/BookStore.csproj +2 -2
- data/tracks/csharp/exercises/bowling/Bowling.csproj +2 -2
- data/tracks/csharp/exercises/bracket-push/BracketPush.csproj +2 -2
- data/tracks/csharp/exercises/change/Change.csproj +2 -2
- data/tracks/csharp/exercises/circular-buffer/CircularBuffer.csproj +2 -2
- data/tracks/csharp/exercises/clock/Clock.csproj +2 -2
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.csproj +2 -2
- data/tracks/csharp/exercises/complex-numbers/ComplexNumbers.csproj +2 -2
- data/tracks/csharp/exercises/connect/Connect.cs +1 -1
- data/tracks/csharp/exercises/connect/Connect.csproj +2 -2
- data/tracks/csharp/exercises/connect/ConnectTest.cs +120 -85
- data/tracks/csharp/exercises/connect/Example.cs +11 -7
- data/tracks/csharp/exercises/crypto-square/CryptoSquare.csproj +2 -2
- data/tracks/csharp/exercises/custom-set/CustomSet.csproj +2 -2
- data/tracks/csharp/exercises/diamond/Diamond.csproj +2 -2
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquares.csproj +2 -2
- data/tracks/csharp/exercises/diffie-hellman/DiffieHellman.csproj +2 -2
- data/tracks/csharp/exercises/dominoes/Dominoes.csproj +2 -2
- data/tracks/csharp/exercises/dot-dsl/DotDsl.csproj +2 -2
- data/tracks/csharp/exercises/error-handling/ErrorHandling.csproj +2 -2
- data/tracks/csharp/exercises/etl/Etl.csproj +2 -2
- data/tracks/csharp/exercises/flatten-array/FlattenArray.csproj +2 -2
- data/tracks/csharp/exercises/food-chain/FoodChain.csproj +2 -2
- data/tracks/csharp/exercises/forth/Forth.csproj +2 -2
- data/tracks/csharp/exercises/gigasecond/Gigasecond.csproj +2 -2
- data/tracks/csharp/exercises/go-counting/GoCounting.csproj +2 -2
- data/tracks/csharp/exercises/grade-school/GradeSchool.csproj +2 -2
- data/tracks/csharp/exercises/grains/Grains.csproj +2 -2
- data/tracks/csharp/exercises/grep/Grep.csproj +2 -2
- data/tracks/csharp/exercises/hamming/Hamming.csproj +2 -2
- data/tracks/csharp/exercises/hangman/Hangman.csproj +2 -2
- data/tracks/csharp/exercises/hello-world/HelloWorld.csproj +2 -2
- data/tracks/csharp/exercises/house/House.csproj +2 -2
- data/tracks/csharp/exercises/isogram/Isogram.csproj +2 -2
- data/tracks/csharp/exercises/kindergarten-garden/KindergartenGarden.csproj +2 -2
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProduct.csproj +2 -2
- data/tracks/csharp/exercises/leap/Leap.csproj +2 -2
- data/tracks/csharp/exercises/ledger/Ledger.csproj +2 -2
- data/tracks/csharp/exercises/linked-list/LinkedList.csproj +2 -2
- data/tracks/csharp/exercises/list-ops/ListOps.csproj +2 -2
- data/tracks/csharp/exercises/luhn/Luhn.csproj +2 -2
- data/tracks/csharp/exercises/markdown/Markdown.csproj +2 -2
- data/tracks/csharp/exercises/matrix/Matrix.csproj +2 -2
- data/tracks/csharp/exercises/meetup/Meetup.csproj +2 -2
- data/tracks/csharp/exercises/minesweeper/Minesweeper.csproj +2 -2
- data/tracks/csharp/exercises/nth-prime/NthPrime.csproj +2 -2
- data/tracks/csharp/exercises/nucleotide-count/NucleotideCount.csproj +2 -2
- data/tracks/csharp/exercises/ocr-numbers/OcrNumbers.csproj +2 -2
- data/tracks/csharp/exercises/palindrome-products/PalindromeProducts.csproj +2 -2
- data/tracks/csharp/exercises/pangram/Pangram.csproj +2 -2
- data/tracks/csharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.csproj +2 -2
- data/tracks/csharp/exercises/pascals-triangle/PascalsTriangle.csproj +2 -2
- data/tracks/csharp/exercises/perfect-numbers/PerfectNumbers.csproj +2 -2
- data/tracks/csharp/exercises/phone-number/PhoneNumber.csproj +2 -2
- data/tracks/csharp/exercises/pig-latin/PigLatin.csproj +2 -2
- data/tracks/csharp/exercises/poker/Poker.csproj +2 -2
- data/tracks/csharp/exercises/pov/Pov.csproj +2 -2
- data/tracks/csharp/exercises/prime-factors/PrimeFactors.csproj +2 -2
- data/tracks/csharp/exercises/protein-translation/ProteinTranslation.csproj +2 -2
- data/tracks/csharp/exercises/proverb/Proverb.csproj +2 -2
- data/tracks/csharp/exercises/pythagorean-triplet/PythagoreanTriplet.csproj +2 -2
- data/tracks/csharp/exercises/queen-attack/QueenAttack.csproj +2 -2
- data/tracks/csharp/exercises/rail-fence-cipher/RailFenceCipher.csproj +2 -2
- data/tracks/csharp/exercises/raindrops/Raindrops.csproj +2 -2
- data/tracks/csharp/exercises/react/React.csproj +2 -2
- data/tracks/csharp/exercises/rectangles/Rectangles.csproj +2 -2
- data/tracks/csharp/exercises/rna-transcription/RnaTranscription.csproj +2 -2
- data/tracks/csharp/exercises/robot-name/RobotName.csproj +2 -2
- data/tracks/csharp/exercises/robot-simulator/RobotSimulator.csproj +2 -2
- data/tracks/csharp/exercises/roman-numerals/RomanNumerals.csproj +2 -2
- data/tracks/csharp/exercises/rotational-cipher/RotationalCipher.csproj +2 -2
- data/tracks/csharp/exercises/run-length-encoding/RunLengthEncoding.csproj +2 -2
- data/tracks/csharp/exercises/saddle-points/SaddlePoints.csproj +2 -2
- data/tracks/csharp/exercises/say/Say.csproj +2 -2
- data/tracks/csharp/exercises/scale-generator/ScaleGenerator.csproj +2 -2
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScore.csproj +2 -2
- data/tracks/csharp/exercises/secret-handshake/SecretHandshake.csproj +2 -2
- data/tracks/csharp/exercises/series/Series.csproj +2 -2
- data/tracks/csharp/exercises/series/SeriesTest.cs +17 -17
- data/tracks/csharp/exercises/sgf-parsing/SgfParsing.csproj +2 -2
- data/tracks/csharp/exercises/sieve/Sieve.csproj +2 -2
- data/tracks/csharp/exercises/simple-cipher/SimpleCipher.csproj +2 -2
- data/tracks/csharp/exercises/simple-linked-list/SimpleLinkedList.csproj +2 -2
- data/tracks/csharp/exercises/space-age/SpaceAge.csproj +2 -2
- data/tracks/csharp/exercises/spiral-matrix/SpiralMatrix.csproj +2 -2
- data/tracks/csharp/exercises/strain/Strain.csproj +2 -2
- data/tracks/csharp/exercises/sublist/Sublist.csproj +2 -2
- data/tracks/csharp/exercises/sum-of-multiples/SumOfMultiples.csproj +2 -2
- data/tracks/csharp/exercises/tournament/Tournament.csproj +2 -2
- data/tracks/csharp/exercises/transpose/Transpose.csproj +2 -2
- data/tracks/csharp/exercises/tree-building/TreeBuilding.csproj +2 -2
- data/tracks/csharp/exercises/triangle/Triangle.cs +0 -11
- data/tracks/csharp/exercises/triangle/Triangle.csproj +2 -2
- data/tracks/csharp/exercises/triangle/TriangleTest.cs +17 -17
- data/tracks/csharp/exercises/twelve-days/TwelveDays.csproj +2 -2
- data/tracks/csharp/exercises/two-bucket/TwoBucket.csproj +2 -2
- data/tracks/csharp/exercises/two-fer/TwoFer.csproj +2 -2
- data/tracks/csharp/exercises/variable-length-quantity/VariableLengthQuantity.csproj +2 -2
- data/tracks/csharp/exercises/word-count/WordCount.csproj +2 -2
- data/tracks/csharp/exercises/word-search/WordSearch.csproj +2 -2
- data/tracks/csharp/exercises/wordy/Wordy.csproj +2 -2
- data/tracks/csharp/exercises/zebra-puzzle/ZebraPuzzle.csproj +2 -2
- data/tracks/csharp/exercises/zipper/Zipper.csproj +2 -2
- data/tracks/csharp/generators/Exercises/Connect.cs +47 -0
- data/tracks/csharp/generators/Exercises/Triangle.cs +1 -1
- data/tracks/dart/config/maintainers.json +27 -1
- data/tracks/dart/pubspec.yaml +3 -0
- data/tracks/dart/tool/create-exercise +144 -5
- data/tracks/elm/.gitattributes +1 -0
- data/tracks/elm/bin/install-elm-format +9 -3
- data/tracks/elm/config.json +30 -0
- data/tracks/elm/exercises/all-your-base/AllYourBase.elm +1 -0
- data/tracks/elm/exercises/all-your-base/AllYourBase.example.elm +68 -0
- data/tracks/elm/exercises/all-your-base/README.md +65 -0
- data/tracks/elm/exercises/all-your-base/elm-package.json +15 -0
- data/tracks/elm/exercises/all-your-base/tests/Tests.elm +53 -0
- data/tracks/elm/exercises/all-your-base/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/collatz-conjecture/CollatzConjecture.elm +2 -0
- data/tracks/elm/exercises/collatz-conjecture/CollatzConjecture.example.elm +19 -0
- data/tracks/elm/exercises/collatz-conjecture/elm-package.json +15 -0
- data/tracks/elm/exercises/collatz-conjecture/package.json +14 -0
- data/tracks/elm/exercises/collatz-conjecture/tests/Tests.elm +38 -0
- data/tracks/elm/exercises/collatz-conjecture/tests/elm-package.json +16 -0
- data/tracks/elm/exercises/isogram/Isogram.elm +1 -0
- data/tracks/elm/exercises/isogram/Isogram.example.elm +76 -0
- data/tracks/elm/exercises/isogram/README.md +50 -0
- data/tracks/elm/exercises/isogram/elm-package.json +14 -0
- data/tracks/elm/exercises/isogram/package.json +14 -0
- data/tracks/elm/exercises/isogram/tests/Tests.elm +46 -0
- data/tracks/elm/exercises/isogram/tests/elm-package.json +16 -0
- data/tracks/fsharp/.gitignore +2 -1
- data/tracks/fsharp/exercises/accumulate/Accumulate.fsproj +3 -2
- data/tracks/fsharp/exercises/acronym/Acronym.fs +1 -1
- data/tracks/fsharp/exercises/acronym/Acronym.fsproj +3 -2
- data/tracks/fsharp/exercises/acronym/AcronymTest.fs +13 -38
- data/tracks/fsharp/exercises/acronym/Example.fs +1 -1
- data/tracks/fsharp/exercises/all-your-base/AllYourBase.fsproj +3 -2
- data/tracks/fsharp/exercises/all-your-base/AllYourBaseTest.fs +64 -61
- data/tracks/fsharp/exercises/all-your-base/Example.fs +4 -1
- data/tracks/fsharp/exercises/allergies/Allergies.fs +2 -2
- data/tracks/fsharp/exercises/allergies/Allergies.fsproj +3 -2
- data/tracks/fsharp/exercises/allergies/AllergiesTest.fs +28 -37
- data/tracks/fsharp/exercises/allergies/Example.fs +3 -3
- data/tracks/fsharp/exercises/alphametics/Alphametics.fsproj +3 -2
- data/tracks/fsharp/exercises/anagram/Anagram.fsproj +3 -2
- data/tracks/fsharp/exercises/atbash-cipher/AtbashCipher.fs +4 -2
- data/tracks/fsharp/exercises/atbash-cipher/AtbashCipher.fsproj +3 -2
- data/tracks/fsharp/exercises/atbash-cipher/AtbashCipherTest.fs +38 -42
- data/tracks/fsharp/exercises/atbash-cipher/Example.fs +5 -3
- data/tracks/fsharp/exercises/bank-account/BankAccount.fsproj +3 -2
- data/tracks/fsharp/exercises/beer-song/BeerSong.fsproj +3 -2
- data/tracks/fsharp/exercises/beer-song/BeerSongTest.fs +36 -32
- data/tracks/fsharp/exercises/beer-song/Example.fs +2 -2
- data/tracks/fsharp/exercises/binary-search/BinarySearch.fsproj +3 -2
- data/tracks/fsharp/exercises/binary-search-tree/BinarySearchTree.fsproj +3 -2
- data/tracks/fsharp/exercises/bob/Bob.fs +1 -1
- data/tracks/fsharp/exercises/bob/Bob.fsproj +3 -2
- data/tracks/fsharp/exercises/bob/BobTest.fs +64 -20
- data/tracks/fsharp/exercises/bob/Example.fs +3 -4
- data/tracks/fsharp/exercises/book-store/BookStore.fs +1 -1
- data/tracks/fsharp/exercises/book-store/BookStore.fsproj +3 -2
- data/tracks/fsharp/exercises/book-store/BookStoreTest.fs +32 -25
- data/tracks/fsharp/exercises/book-store/Example.fs +1 -1
- data/tracks/fsharp/exercises/bowling/Bowling.fsproj +3 -2
- data/tracks/fsharp/exercises/bracket-push/BracketPush.fs +1 -1
- data/tracks/fsharp/exercises/bracket-push/BracketPush.fsproj +3 -2
- data/tracks/fsharp/exercises/bracket-push/BracketPushTest.fs +24 -25
- data/tracks/fsharp/exercises/bracket-push/Example.fs +1 -1
- data/tracks/fsharp/exercises/change/Change.fs +1 -1
- data/tracks/fsharp/exercises/change/Change.fsproj +3 -2
- data/tracks/fsharp/exercises/change/ChangeTest.fs +42 -18
- data/tracks/fsharp/exercises/change/Example.fs +7 -4
- data/tracks/fsharp/exercises/circular-buffer/CircularBuffer.fsproj +3 -2
- data/tracks/fsharp/exercises/clock/Clock.fsproj +3 -2
- data/tracks/fsharp/exercises/connect/Connect.fsproj +3 -2
- data/tracks/fsharp/exercises/crypto-square/CryptoSquare.fs +1 -40
- data/tracks/fsharp/exercises/crypto-square/CryptoSquare.fsproj +3 -2
- data/tracks/fsharp/exercises/crypto-square/CryptoSquareTest.fs +16 -40
- data/tracks/fsharp/exercises/crypto-square/Example.fs +13 -16
- data/tracks/fsharp/exercises/custom-set/CustomSet.fs +12 -12
- data/tracks/fsharp/exercises/custom-set/CustomSet.fsproj +3 -2
- data/tracks/fsharp/exercises/diamond/Diamond.fsproj +3 -2
- data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquares.fs +2 -2
- data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquares.fsproj +3 -2
- data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquaresTest.fs +24 -20
- data/tracks/fsharp/exercises/difference-of-squares/Example.fs +3 -3
- data/tracks/fsharp/exercises/diffie-hellman/DiffieHellman.fsproj +3 -2
- data/tracks/fsharp/exercises/dominoes/Dominoes.fsproj +3 -2
- data/tracks/fsharp/exercises/dot-dsl/DotDsl.fsproj +3 -2
- data/tracks/fsharp/exercises/error-handling/ErrorHandling.fsproj +3 -2
- data/tracks/fsharp/exercises/etl/Etl.fsproj +3 -2
- data/tracks/fsharp/exercises/food-chain/FoodChain.fsproj +3 -2
- data/tracks/fsharp/exercises/forth/Forth.fsproj +3 -2
- data/tracks/fsharp/exercises/gigasecond/Example.fs +1 -3
- data/tracks/fsharp/exercises/gigasecond/Gigasecond.fs +1 -1
- data/tracks/fsharp/exercises/gigasecond/Gigasecond.fsproj +3 -2
- data/tracks/fsharp/exercises/gigasecond/GigasecondTest.fs +21 -12
- data/tracks/fsharp/exercises/go-counting/GoCounting.fsproj +3 -2
- data/tracks/fsharp/exercises/grade-school/GradeSchool.fsproj +3 -2
- data/tracks/fsharp/exercises/grains/Grains.fsproj +3 -2
- data/tracks/fsharp/exercises/grep/Grep.fsproj +3 -2
- data/tracks/fsharp/exercises/hamming/Hamming.fsproj +3 -2
- data/tracks/fsharp/exercises/hangman/Hangman.fsproj +3 -2
- data/tracks/fsharp/exercises/hello-world/HelloWorld.fsproj +3 -2
- data/tracks/fsharp/exercises/hello-world/HelloWorldTest.fs +6 -3
- data/tracks/fsharp/exercises/house/House.fsproj +3 -2
- data/tracks/fsharp/exercises/isogram/Example.fs +1 -1
- data/tracks/fsharp/exercises/isogram/Isogram.fs +1 -1
- data/tracks/fsharp/exercises/isogram/Isogram.fsproj +3 -2
- data/tracks/fsharp/exercises/isogram/IsogramTest.fs +16 -40
- data/tracks/fsharp/exercises/kindergarten-garden/Example.fs +6 -4
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGarden.fs +3 -5
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGarden.fsproj +3 -2
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGardenTest.fs +100 -47
- data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProduct.fsproj +3 -2
- data/tracks/fsharp/exercises/leap/Example.fs +2 -2
- data/tracks/fsharp/exercises/leap/Leap.fs +2 -2
- data/tracks/fsharp/exercises/leap/Leap.fsproj +3 -2
- data/tracks/fsharp/exercises/leap/LeapTest.fs +19 -15
- data/tracks/fsharp/exercises/ledger/Ledger.fsproj +3 -2
- data/tracks/fsharp/exercises/lens-person/LensPerson.fsproj +3 -2
- data/tracks/fsharp/exercises/linked-list/LinkedList.fsproj +3 -2
- data/tracks/fsharp/exercises/list-ops/ListOps.fsproj +3 -2
- data/tracks/fsharp/exercises/luhn/Luhn.fsproj +3 -2
- data/tracks/fsharp/exercises/luhn/LuhnTest.fs +30 -65
- data/tracks/fsharp/exercises/markdown/Markdown.fsproj +3 -2
- data/tracks/fsharp/exercises/matrix/Matrix.fsproj +3 -2
- data/tracks/fsharp/exercises/meetup/Meetup.fsproj +3 -2
- data/tracks/fsharp/exercises/minesweeper/Example.fs +9 -11
- data/tracks/fsharp/exercises/minesweeper/Minesweeper.fsproj +3 -2
- data/tracks/fsharp/exercises/minesweeper/MinesweeperTest.fs +117 -80
- data/tracks/fsharp/exercises/nth-prime/NthPrime.fsproj +3 -2
- data/tracks/fsharp/exercises/nucleotide-count/NucleotideCount.fsproj +3 -2
- data/tracks/fsharp/exercises/ocr-numbers/OcrNumbers.fsproj +3 -2
- data/tracks/fsharp/exercises/palindrome-products/PalindromeProducts.fsproj +3 -2
- data/tracks/fsharp/exercises/pangram/Pangram.fsproj +3 -2
- data/tracks/fsharp/exercises/pangram/PangramTest.fs +15 -27
- data/tracks/fsharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.fsproj +3 -2
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangle.fsproj +3 -2
- data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbers.fsproj +3 -2
- data/tracks/fsharp/exercises/phone-number/PhoneNumber.fsproj +3 -2
- data/tracks/fsharp/exercises/pig-latin/Example.fs +1 -1
- data/tracks/fsharp/exercises/pig-latin/PigLatin.fsproj +3 -2
- data/tracks/fsharp/exercises/pig-latin/PigLatinTest.fs +64 -26
- data/tracks/fsharp/exercises/poker/Poker.fsproj +3 -2
- data/tracks/fsharp/exercises/pov/Pov.fsproj +3 -2
- data/tracks/fsharp/exercises/prime-factors/PrimeFactors.fsproj +3 -2
- data/tracks/fsharp/exercises/protein-translation/ProteinTranslation.fsproj +3 -2
- data/tracks/fsharp/exercises/proverb/Proverb.fsproj +3 -2
- data/tracks/fsharp/exercises/pythagorean-triplet/PythagoreanTriplet.fsproj +3 -2
- data/tracks/fsharp/exercises/queen-attack/Example.fs +3 -1
- data/tracks/fsharp/exercises/queen-attack/QueenAttack.fs +2 -0
- data/tracks/fsharp/exercises/queen-attack/QueenAttack.fsproj +3 -2
- data/tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs +50 -20
- data/tracks/fsharp/exercises/rail-fence-cipher/RailFenceCipher.fsproj +3 -2
- data/tracks/fsharp/exercises/raindrops/Raindrops.fsproj +3 -2
- data/tracks/fsharp/exercises/raindrops/RaindropsTest.fs +77 -37
- data/tracks/fsharp/exercises/react/React.fsproj +3 -2
- data/tracks/fsharp/exercises/rectangles/Rectangles.fsproj +3 -2
- data/tracks/fsharp/exercises/rna-transcription/Example.fs +15 -7
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fs +2 -2
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fsproj +3 -2
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscriptionTest.fs +29 -14
- data/tracks/fsharp/exercises/robot-name/RobotName.fsproj +3 -2
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fsproj +3 -2
- data/tracks/fsharp/exercises/roman-numerals/Example.fs +2 -2
- data/tracks/fsharp/exercises/roman-numerals/RomanNumerals.fs +2 -2
- data/tracks/fsharp/exercises/roman-numerals/RomanNumerals.fsproj +3 -2
- data/tracks/fsharp/exercises/roman-numerals/RomanNumeralsTest.fs +79 -26
- data/tracks/fsharp/exercises/run-length-encoding/RunLengthEncoding.fsproj +3 -2
- data/tracks/fsharp/exercises/saddle-points/SaddlePoints.fsproj +3 -2
- data/tracks/fsharp/exercises/say/Say.fsproj +3 -2
- data/tracks/fsharp/exercises/scale-generator/ScaleGenerator.fsproj +3 -2
- data/tracks/fsharp/exercises/scrabble-score/ScrabbleScore.fsproj +3 -2
- data/tracks/fsharp/exercises/scrabble-score/ScrabbleScoreTest.fs +33 -17
- data/tracks/fsharp/exercises/secret-handshake/SecretHandshake.fsproj +3 -2
- data/tracks/fsharp/exercises/series/Series.fsproj +3 -2
- data/tracks/fsharp/exercises/sgf-parsing/SgfParsing.fsproj +3 -2
- data/tracks/fsharp/exercises/sieve/Sieve.fsproj +3 -2
- data/tracks/fsharp/exercises/simple-cipher/SimpleCipher.fsproj +3 -2
- data/tracks/fsharp/exercises/simple-linked-list/SimpleLinkedList.fsproj +3 -2
- data/tracks/fsharp/exercises/space-age/SpaceAge.fsproj +3 -2
- data/tracks/fsharp/exercises/strain/Strain.fsproj +3 -2
- data/tracks/fsharp/exercises/sublist/Sublist.fsproj +3 -2
- data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiples.fsproj +3 -2
- data/tracks/fsharp/exercises/tournament/Tournament.fsproj +3 -2
- data/tracks/fsharp/exercises/transpose/Transpose.fsproj +3 -2
- data/tracks/fsharp/exercises/tree-building/TreeBuilding.fsproj +3 -2
- data/tracks/fsharp/exercises/triangle/Triangle.fsproj +3 -2
- data/tracks/fsharp/exercises/twelve-days/TwelveDays.fsproj +3 -2
- data/tracks/fsharp/exercises/two-bucket/TwoBucket.fsproj +3 -2
- data/tracks/fsharp/exercises/two-fer/TwoFer.fsproj +3 -2
- data/tracks/fsharp/exercises/variable-length-quantity/VariableLengthQuantity.fsproj +3 -2
- data/tracks/fsharp/exercises/word-count/WordCount.fsproj +3 -2
- data/tracks/fsharp/exercises/word-search/WordSearch.fsproj +3 -2
- data/tracks/fsharp/exercises/wordy/Wordy.fsproj +3 -2
- data/tracks/fsharp/exercises/zebra-puzzle/ZebraPuzzle.fsproj +3 -2
- data/tracks/fsharp/exercises/zipper/Zipper.fsproj +3 -2
- data/tracks/fsharp/generators/Common.fs +96 -0
- data/tracks/fsharp/generators/Exercise.fs +250 -0
- data/tracks/fsharp/generators/Generators.fs +210 -0
- data/tracks/fsharp/generators/Generators.fsproj +32 -0
- data/tracks/fsharp/generators/Generators.sln +24 -0
- data/tracks/fsharp/generators/Input.fs +99 -0
- data/tracks/fsharp/generators/Options.fs +31 -0
- data/tracks/fsharp/generators/Output.fs +224 -0
- data/tracks/fsharp/generators/Program.fs +35 -0
- data/tracks/fsharp/generators/Properties/launchSettings.json +8 -0
- data/tracks/fsharp/generators/Templates/_AssertEmpty.liquid +1 -0
- data/tracks/fsharp/generators/Templates/_AssertEqual.liquid +1 -0
- data/tracks/fsharp/generators/Templates/_TestClass.liquid +13 -0
- data/tracks/fsharp/generators/Templates/_TestMethod.liquid +3 -0
- data/tracks/fsharp/generators/Templates/_TestMethodBody.liquid +4 -0
- data/tracks/go/.travis.yml +3 -3
- data/tracks/groovy/CONTRIBUTING.md +2 -2
- data/tracks/groovy/config.json +12 -0
- data/tracks/groovy/exercises/scrabble-score/Example.groovy +18 -0
- data/tracks/groovy/exercises/scrabble-score/README.md +63 -0
- data/tracks/groovy/exercises/scrabble-score/ScrabbleScore.groovy +7 -0
- data/tracks/groovy/exercises/scrabble-score/ScrabbleScoreSpec.groovy +45 -0
- data/tracks/groovy/exercises/two-fer/TwoFer.groovy +2 -2
- data/tracks/haskell/exercises/change/README.md +1 -1
- data/tracks/haskell/exercises/lens-person/README.md +1 -1
- data/tracks/haskell/exercises/palindrome-products/README.md +5 -12
- data/tracks/haskell/exercises/sum-of-multiples/README.md +0 -3
- data/tracks/idris/config.json +12 -0
- data/tracks/idris/exercises/accumulate/Accumulate.ipkg +5 -0
- data/tracks/idris/exercises/accumulate/Makefile +23 -0
- data/tracks/idris/exercises/accumulate/README.md +32 -0
- data/tracks/idris/exercises/accumulate/src/Example.idr +6 -0
- data/tracks/idris/exercises/accumulate/src/Test/Accumulate.idr +35 -0
- data/tracks/java/config/maintainers.json +4 -7
- data/tracks/java/config.json +99 -22
- data/tracks/java/exercises/binary-search-tree/.meta/src/reference/java/{BST.java → BinarySearchTree.java} +1 -1
- data/tracks/java/exercises/binary-search-tree/src/test/java/{BSTTest.java → BinarySearchTreeTest.java} +34 -36
- data/tracks/java/exercises/robot-simulator/src/main/java/GridPosition.java +19 -15
- data/tracks/java/exercises/saddle-points/.meta/src/reference/java/MatrixCoordinate.java +7 -1
- data/tracks/java/exercises/saddle-points/src/main/java/MatrixCoordinate.java +7 -1
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/tournament/.meta/src/reference/java/Result.java +5 -0
- data/tracks/java/exercises/tournament/.meta/src/reference/java/TeamResult.java +41 -0
- data/tracks/java/exercises/tournament/.meta/src/reference/java/Tournament.java +62 -0
- data/tracks/java/exercises/tournament/README.md +78 -0
- data/tracks/java/exercises/tournament/build.gradle +18 -0
- data/tracks/java/{.Rhistory → exercises/tournament/src/main/java/.keep} +0 -0
- data/tracks/java/exercises/tournament/src/test/java/TournamentTest.java +160 -0
- data/tracks/php/config.json +14 -0
- data/tracks/php/exercises/collatz-conjecture/collatz-conjecture_test.php +44 -0
- data/tracks/php/exercises/collatz-conjecture/example.php +18 -0
- data/tracks/python/exercises/circular-buffer/circular_buffer.py +1 -1
- data/tracks/python/exercises/clock/clock.py +1 -1
- data/tracks/python/exercises/etl/etl.py +1 -1
- data/tracks/python/exercises/grade-school/grade_school.py +1 -1
- data/tracks/python/exercises/grains/grains.py +2 -2
- data/tracks/python/exercises/kindergarten-garden/kindergarten_garden.py +1 -1
- data/tracks/python/exercises/linked-list/linked_list.py +1 -1
- data/tracks/python/exercises/rectangles/rectangles.py +1 -1
- data/tracks/python/exercises/sum-of-multiples/sum_of_multiples.py +1 -1
- data/tracks/rust/exercises/bob/tests/bob.rs +1 -0
- data/tracks/rust/exercises/crypto-square/tests/crypto-square.rs +7 -0
- data/tracks/rust/exercises/gigasecond/tests/gigasecond.rs +1 -1
- data/tracks/rust/exercises/phone-number/Cargo.lock +1 -1
- data/tracks/rust/exercises/phone-number/Cargo.toml +1 -1
- data/tracks/rust/exercises/phone-number/example.rs +17 -23
- data/tracks/rust/exercises/phone-number/tests/phone-number.rs +31 -40
- data/tracks/rust/exercises/say/tests/say.rs +2 -0
- data/tracks/rust/exercises/sum-of-multiples/README.md +0 -3
- data/tracks/scala/config.json +11 -0
- data/tracks/scala/exercises/collatz-conjecture/README.md +43 -0
- data/tracks/scala/exercises/collatz-conjecture/build.sbt +3 -0
- data/tracks/scala/exercises/collatz-conjecture/example.scala +17 -0
- data/tracks/scala/exercises/collatz-conjecture/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/collatz-conjecture/src/test/scala/CollatzConjectureTest.scala +34 -0
- data/tracks/scala/testgen/src/main/scala/CollatzConjectureTestGenerator.scala +35 -0
- data/tracks/scheme/config.json +8 -0
- data/tracks/scheme/exercises/word-count/README.md +19 -0
- data/tracks/scheme/exercises/word-count/example.scm +27 -0
- data/tracks/scheme/exercises/word-count/word-count-test.scm +90 -0
- data/tracks/scheme/exercises/word-count/word-count.scm +5 -0
- data/tracks/sml/README.md +20 -1
- data/tracks/sml/bin/generate +74 -20
- data/tracks/sml/exercises/binary/README.md +23 -5
- data/tracks/sml/exercises/binary/binary.sml +2 -0
- data/tracks/sml/exercises/binary/example.sml +10 -21
- data/tracks/sml/exercises/binary/test.sml +55 -30
- data/tracks/sml/exercises/binary/testlib.sml +159 -0
- data/tracks/sml/exercises/flatten-array/HINTS.md +8 -0
- data/tracks/sml/exercises/flatten-array/README.md +31 -6
- data/tracks/sml/exercises/flatten-array/example.sml +3 -4
- data/tracks/sml/exercises/flatten-array/flatten-array.sml +4 -5
- data/tracks/sml/exercises/flatten-array/test.sml +76 -52
- data/tracks/sml/exercises/flatten-array/testlib.sml +159 -0
- data/tracks/sml/exercises/nth-prime/HINTS.md +9 -0
- data/tracks/sml/exercises/nth-prime/README.md +32 -5
- data/tracks/sml/exercises/nth-prime/example.sml +28 -46
- data/tracks/sml/exercises/nth-prime/nth-prime.sml +1 -1
- data/tracks/sml/exercises/nth-prime/test.sml +19 -63
- data/tracks/sml/exercises/nth-prime/testlib.sml +159 -0
- data/tracks/sml/exercises/raindrops/README.md +21 -5
- data/tracks/typescript/config.json +14 -0
- data/tracks/typescript/exercises/triangle/README.md +55 -0
- data/tracks/typescript/exercises/triangle/package.json +36 -0
- data/tracks/typescript/exercises/triangle/triangle.example.ts +56 -0
- data/tracks/typescript/exercises/triangle/triangle.test.ts +79 -0
- data/tracks/typescript/exercises/triangle/triangle.ts +12 -0
- data/tracks/typescript/exercises/triangle/tsconfig.json +22 -0
- data/tracks/typescript/exercises/triangle/tslint.json +127 -0
- data/tracks/typescript/exercises/triangle/yarn.lock +2305 -0
- metadata +85 -6
- data/tracks/d/exercises/crypto-square/.dub/dub.json +0 -6
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
2
|
+
# Visual Studio 15
|
|
3
|
+
VisualStudioVersion = 15.0.26730.12
|
|
4
|
+
MinimumVisualStudioVersion = 15.0.26124.0
|
|
5
|
+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Generators", "Generators.fsproj", "{083C3030-8EC9-4EB7-BBD2-989BD4CE28FE}"
|
|
6
|
+
EndProject
|
|
7
|
+
Global
|
|
8
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
9
|
+
Debug|Any CPU = Debug|Any CPU
|
|
10
|
+
Release|Any CPU = Release|Any CPU
|
|
11
|
+
EndGlobalSection
|
|
12
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
13
|
+
{083C3030-8EC9-4EB7-BBD2-989BD4CE28FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
14
|
+
{083C3030-8EC9-4EB7-BBD2-989BD4CE28FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
15
|
+
{083C3030-8EC9-4EB7-BBD2-989BD4CE28FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
16
|
+
{083C3030-8EC9-4EB7-BBD2-989BD4CE28FE}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
17
|
+
EndGlobalSection
|
|
18
|
+
GlobalSection(SolutionProperties) = preSolution
|
|
19
|
+
HideSolutionNode = FALSE
|
|
20
|
+
EndGlobalSection
|
|
21
|
+
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
22
|
+
SolutionGuid = {57678E76-BB77-4CB6-AD28-77C5DC345BDE}
|
|
23
|
+
EndGlobalSection
|
|
24
|
+
EndGlobal
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
module Generators.Input
|
|
2
|
+
|
|
3
|
+
open System
|
|
4
|
+
open System.IO
|
|
5
|
+
open System.Collections.Generic
|
|
6
|
+
open Serilog
|
|
7
|
+
open LibGit2Sharp
|
|
8
|
+
open Newtonsoft.Json
|
|
9
|
+
open Newtonsoft.Json.Linq
|
|
10
|
+
open Newtonsoft.Json.Serialization
|
|
11
|
+
open Humanizer
|
|
12
|
+
open Options
|
|
13
|
+
|
|
14
|
+
let [<Literal>] private ProblemSpecificationsGitUrl = "https://github.com/exercism/problem-specifications.git";
|
|
15
|
+
let [<Literal>] private ProblemSpecificationsBranch = "master";
|
|
16
|
+
let [<Literal>] private ProblemSpecificationsRemote = "origin";
|
|
17
|
+
let [<Literal>] private ProblemSpecificationsRemoteBranch = ProblemSpecificationsRemote + "/" + ProblemSpecificationsBranch;
|
|
18
|
+
|
|
19
|
+
let private cloneRepository options =
|
|
20
|
+
if (Directory.Exists(options.CanonicalDataDirectory)) then
|
|
21
|
+
()
|
|
22
|
+
else
|
|
23
|
+
Log.Information("Cloning repository...")
|
|
24
|
+
|
|
25
|
+
Repository.Clone(ProblemSpecificationsGitUrl, options.CanonicalDataDirectory) |> ignore
|
|
26
|
+
|
|
27
|
+
Log.Information("Repository cloned.")
|
|
28
|
+
|
|
29
|
+
let private updateToLatestVersion options =
|
|
30
|
+
Log.Information("Updating repository to latest version...");
|
|
31
|
+
|
|
32
|
+
use repository = new Repository(options.CanonicalDataDirectory)
|
|
33
|
+
|
|
34
|
+
Commands.Fetch(repository, ProblemSpecificationsRemote, Seq.empty, FetchOptions(), null)
|
|
35
|
+
|
|
36
|
+
let remoteBranch = repository.Branches.[ProblemSpecificationsRemoteBranch];
|
|
37
|
+
repository.Reset(ResetMode.Hard, remoteBranch.Tip);
|
|
38
|
+
|
|
39
|
+
Log.Information("Updated repository to latest version.");
|
|
40
|
+
|
|
41
|
+
let private downloadData options =
|
|
42
|
+
if options.SkipUpdateCanonicalData then
|
|
43
|
+
()
|
|
44
|
+
else
|
|
45
|
+
cloneRepository options
|
|
46
|
+
updateToLatestVersion options
|
|
47
|
+
|
|
48
|
+
let private readCanonicalData options exercise =
|
|
49
|
+
let exerciseCanonicalDataPath = Path.Combine(options.CanonicalDataDirectory, "exercises", exercise, "canonical-data.json")
|
|
50
|
+
File.ReadAllText(exerciseCanonicalDataPath)
|
|
51
|
+
|
|
52
|
+
let jsonSerializerSettings = JsonSerializerSettings()
|
|
53
|
+
let jsonSerializer = JsonSerializer()
|
|
54
|
+
|
|
55
|
+
type CanonicalDataConverter() =
|
|
56
|
+
inherit JsonConverter()
|
|
57
|
+
|
|
58
|
+
let createCanonicalDataCasePropertiesFromJToken (jToken: JToken) =
|
|
59
|
+
jToken.ToObject<IDictionary<string, obj>>()
|
|
60
|
+
|> Dict.toMap
|
|
61
|
+
|
|
62
|
+
let createDescriptionPathFromJToken (jToken: JToken): string list =
|
|
63
|
+
let descriptionFromJToken (currentToken: JToken) =
|
|
64
|
+
match currentToken.SelectToken("description") with
|
|
65
|
+
| null -> None
|
|
66
|
+
| description -> Some (description.ToObject<string>())
|
|
67
|
+
|
|
68
|
+
jToken
|
|
69
|
+
|> Json.parentsAndSelf
|
|
70
|
+
|> List.choose descriptionFromJToken
|
|
71
|
+
|
|
72
|
+
let createCanonicalDataCaseFromJToken (jToken: JToken) =
|
|
73
|
+
{ Properties = createCanonicalDataCasePropertiesFromJToken jToken
|
|
74
|
+
DescriptionPath = createDescriptionPathFromJToken jToken }
|
|
75
|
+
|
|
76
|
+
let createCanonicalDataCasesFromJToken (jToken: JToken) =
|
|
77
|
+
jToken.["cases"].SelectTokens("$..*[?(@.property)]")
|
|
78
|
+
|> Seq.map createCanonicalDataCaseFromJToken
|
|
79
|
+
|> Seq.toList
|
|
80
|
+
|
|
81
|
+
let createCanonicalDataFromJToken (jToken: JToken) =
|
|
82
|
+
{ Exercise = jToken.["exercise"].Value<string>()
|
|
83
|
+
Version = jToken.["version"].Value<string>()
|
|
84
|
+
Cases = createCanonicalDataCasesFromJToken jToken }
|
|
85
|
+
|
|
86
|
+
override this.WriteJson(writer: JsonWriter, value: obj, serializer: JsonSerializer) = failwith "Not supported"
|
|
87
|
+
|
|
88
|
+
override this.ReadJson(reader: JsonReader, objectType: Type, existingValue: obj, serializer: JsonSerializer) =
|
|
89
|
+
let jToken = JToken.ReadFrom(reader)
|
|
90
|
+
createCanonicalDataFromJToken jToken :> obj
|
|
91
|
+
|
|
92
|
+
override this.CanConvert(objectType: Type) = objectType = typeof<CanonicalData>
|
|
93
|
+
|
|
94
|
+
let convertCanonicalData canonicalDataContents =
|
|
95
|
+
JsonConvert.DeserializeObject<CanonicalData>(canonicalDataContents, CanonicalDataConverter())
|
|
96
|
+
|
|
97
|
+
let parseCanonicalData options =
|
|
98
|
+
downloadData options
|
|
99
|
+
readCanonicalData options >> convertCanonicalData
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module Generators.Options
|
|
2
|
+
|
|
3
|
+
open System
|
|
4
|
+
open System.IO
|
|
5
|
+
open CommandLine
|
|
6
|
+
open Serilog
|
|
7
|
+
open Humanizer
|
|
8
|
+
|
|
9
|
+
type Options = {
|
|
10
|
+
[<CommandLine.Option('e', "exercises", Required = false,
|
|
11
|
+
HelpText = "Exercises to generate (if not specified, defaults to all exercises).")>] Exercises : seq<string>;
|
|
12
|
+
[<CommandLine.Option('d', "canonicaldatadirectory", Required = false,
|
|
13
|
+
HelpText = "Canonical data directory. If the directory does not exist, the canonical data will be downloaded.")>] CanonicalDataDirectory : string;
|
|
14
|
+
[<CommandLine.Option('s', "skipupdatecanonicaldata", Required = false,
|
|
15
|
+
HelpText = "Don't update the canonical data.")>] SkipUpdateCanonicalData : bool;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let private normalizeOptions options =
|
|
19
|
+
if options.CanonicalDataDirectory <> "" then
|
|
20
|
+
options
|
|
21
|
+
else
|
|
22
|
+
let appDataDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
|
|
23
|
+
let defaultCanonicalDataDirectory = Path.Combine(appDataDirectory, "exercism", "problem-specifications")
|
|
24
|
+
{ options with CanonicalDataDirectory = defaultCanonicalDataDirectory }
|
|
25
|
+
|
|
26
|
+
let parseOptions argv =
|
|
27
|
+
let result = CommandLine.Parser.Default.ParseArguments<Options>(argv)
|
|
28
|
+
match result with
|
|
29
|
+
| :? Parsed<Options> as parsed -> Result.Ok(normalizeOptions parsed.Value)
|
|
30
|
+
| :? NotParsed<Options> as notParsed -> Result.Error(notParsed.Errors |> Seq.map string)
|
|
31
|
+
| _ -> Result.Error(seq { yield "Invalid parsing result" })
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
module Generators.Output
|
|
2
|
+
|
|
3
|
+
open System
|
|
4
|
+
open System.Collections.Generic
|
|
5
|
+
open System.IO
|
|
6
|
+
open System.Reflection
|
|
7
|
+
open FSharp.Reflection
|
|
8
|
+
open DotLiquid
|
|
9
|
+
open DotLiquid.FileSystems
|
|
10
|
+
open Newtonsoft.Json.Linq
|
|
11
|
+
open Input
|
|
12
|
+
|
|
13
|
+
let indent level value =
|
|
14
|
+
let indentation = String.replicate level " "
|
|
15
|
+
sprintf "%s%s" indentation value
|
|
16
|
+
|
|
17
|
+
let parenthesize value = sprintf "(%s)" value
|
|
18
|
+
|
|
19
|
+
let backwardPipe value = sprintf "<| %s" value
|
|
20
|
+
|
|
21
|
+
let backwardPipeConditional test value = if test value then backwardPipe value else value
|
|
22
|
+
|
|
23
|
+
let addTypeAnnotation typeAnnotation value = sprintf "%s: %s" value typeAnnotation
|
|
24
|
+
|
|
25
|
+
let escapeSpecialCharacters (str: string) =
|
|
26
|
+
str.Replace("\n", "\\n")
|
|
27
|
+
.Replace("\t", "\\t")
|
|
28
|
+
.Replace("\r", "\\r")
|
|
29
|
+
.Replace("\"", "\\\"")
|
|
30
|
+
|
|
31
|
+
let formatString str =
|
|
32
|
+
str
|
|
33
|
+
|> escapeSpecialCharacters
|
|
34
|
+
|> sprintf "\"%s\""
|
|
35
|
+
|
|
36
|
+
let formatBool b = if b then "true" else "false"
|
|
37
|
+
|
|
38
|
+
let formatDateTime (dateTime: DateTime) =
|
|
39
|
+
if dateTime.TimeOfDay = TimeSpan.Zero then
|
|
40
|
+
sprintf "DateTime(%d, %d, %d)" dateTime.Year dateTime.Month dateTime.Day
|
|
41
|
+
else
|
|
42
|
+
sprintf "DateTime(%d, %d, %d, %d, %d, %d)" dateTime.Year dateTime.Month dateTime.Day dateTime.Hour dateTime.Minute dateTime.Second
|
|
43
|
+
|
|
44
|
+
let formatTimeSpan (timeSpan: TimeSpan) =
|
|
45
|
+
sprintf "TimeSpan(%d, %d, %d)" timeSpan.Hours timeSpan.Minutes timeSpan.Seconds
|
|
46
|
+
|
|
47
|
+
let normalizeJArray (jArray: JArray): obj list =
|
|
48
|
+
let toBoxedList seq =
|
|
49
|
+
seq
|
|
50
|
+
|> Seq.map box
|
|
51
|
+
|> List.ofSeq
|
|
52
|
+
|
|
53
|
+
if jArray.Count = 0 then
|
|
54
|
+
[]
|
|
55
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.Integer) then
|
|
56
|
+
jArray.Values<int>() |> toBoxedList
|
|
57
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.Float) then
|
|
58
|
+
jArray.Values<float>() |> toBoxedList
|
|
59
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.Boolean) then
|
|
60
|
+
jArray.Values<bool>() |> toBoxedList
|
|
61
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.String) then
|
|
62
|
+
jArray.Values<string>() |> toBoxedList
|
|
63
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.Date) then
|
|
64
|
+
jArray.Values<DateTime>() |> toBoxedList
|
|
65
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.TimeSpan) then
|
|
66
|
+
jArray.Values<TimeSpan>() |> toBoxedList
|
|
67
|
+
else if jArray.Children() |> Seq.forall (fun x -> x.Type = JTokenType.Object) then
|
|
68
|
+
jArray.Children() |> Seq.map (fun jObject -> jObject.ToObject<Dictionary<string, obj>>()) |> toBoxedList
|
|
69
|
+
else
|
|
70
|
+
jArray.Values<obj>() |> toBoxedList
|
|
71
|
+
|
|
72
|
+
let formatToken (jToken: JToken) =
|
|
73
|
+
match jToken.Type with
|
|
74
|
+
| JTokenType.Integer -> jToken.ToObject<int>() |> string
|
|
75
|
+
| JTokenType.Float -> jToken.ToObject<float>() |> string
|
|
76
|
+
| JTokenType.Boolean -> jToken.ToObject<bool>() |> formatBool
|
|
77
|
+
| JTokenType.String -> jToken.ToObject<string>() |> formatString
|
|
78
|
+
| JTokenType.Date -> jToken.ToObject<DateTime>() |> formatDateTime
|
|
79
|
+
| JTokenType.TimeSpan -> jToken.ToObject<TimeSpan>() |> formatTimeSpan
|
|
80
|
+
| _ -> string jToken
|
|
81
|
+
|
|
82
|
+
let formatJArray (jArray: JArray) =
|
|
83
|
+
jArray
|
|
84
|
+
|> normalizeJArray
|
|
85
|
+
|> sprintf "%A"
|
|
86
|
+
|
|
87
|
+
let formatTuple tuple = sprintf "%A" tuple
|
|
88
|
+
|
|
89
|
+
let formatRecord record = sprintf "%A" record
|
|
90
|
+
|
|
91
|
+
let formatOption option =
|
|
92
|
+
match option with
|
|
93
|
+
| None -> "None"
|
|
94
|
+
| Some x -> sprintf "Some %s" x
|
|
95
|
+
|
|
96
|
+
let formatResult result =
|
|
97
|
+
match result with
|
|
98
|
+
| Ok x -> sprintf "Ok %s" x
|
|
99
|
+
| Error y -> sprintf "Error %s" y
|
|
100
|
+
|
|
101
|
+
let rec formatValue (value: obj) =
|
|
102
|
+
match value with
|
|
103
|
+
| :? string as s ->
|
|
104
|
+
formatString s
|
|
105
|
+
| :? bool as b ->
|
|
106
|
+
formatBool b
|
|
107
|
+
| :? DateTime as dateTime ->
|
|
108
|
+
formatDateTime dateTime
|
|
109
|
+
| :? JArray as jArray ->
|
|
110
|
+
formatJArray jArray
|
|
111
|
+
| :? JToken as jToken ->
|
|
112
|
+
formatToken jToken
|
|
113
|
+
| :? Option<obj> as option ->
|
|
114
|
+
option |> Option.map formatValue |> formatOption
|
|
115
|
+
| :? Result<obj, obj> as result ->
|
|
116
|
+
result |> Result.map formatValue |> Result.mapError formatValue |> formatResult
|
|
117
|
+
| _ when FSharpType.IsTuple (value.GetType()) ->
|
|
118
|
+
formatTuple value
|
|
119
|
+
| _ when FSharpType.IsRecord (value.GetType()) ->
|
|
120
|
+
formatRecord value
|
|
121
|
+
| _ ->
|
|
122
|
+
string value
|
|
123
|
+
|
|
124
|
+
let formatCollection formatString collection =
|
|
125
|
+
collection
|
|
126
|
+
|> String.concat "; "
|
|
127
|
+
|> sprintf formatString
|
|
128
|
+
|
|
129
|
+
let formatList sequence = formatCollection "[%s]" sequence
|
|
130
|
+
|
|
131
|
+
let formatArray sequence = formatCollection "[|%s|]" sequence
|
|
132
|
+
|
|
133
|
+
let formatSequence sequence = formatCollection "seq {%s}" sequence
|
|
134
|
+
|
|
135
|
+
let formatMultiLineCollection (openPrefix, closePostfix) collection =
|
|
136
|
+
match Seq.length collection with
|
|
137
|
+
| 0 ->
|
|
138
|
+
sprintf "%s%s" openPrefix closePostfix
|
|
139
|
+
| 1 ->
|
|
140
|
+
sprintf "%s%s%s" openPrefix (Seq.head collection) closePostfix
|
|
141
|
+
| length ->
|
|
142
|
+
let lineIndent = String(' ', String.length openPrefix)
|
|
143
|
+
|
|
144
|
+
let formatLine i line =
|
|
145
|
+
match i with
|
|
146
|
+
| 0 ->
|
|
147
|
+
sprintf "%s %s" openPrefix line
|
|
148
|
+
| _ when i = length - 1 ->
|
|
149
|
+
sprintf "%s %s %s" lineIndent line closePostfix
|
|
150
|
+
| _ ->
|
|
151
|
+
sprintf "%s %s" lineIndent line
|
|
152
|
+
|
|
153
|
+
collection
|
|
154
|
+
|> Seq.mapi formatLine
|
|
155
|
+
|> Seq.toList
|
|
156
|
+
|> List.map (indent 2)
|
|
157
|
+
|> String.concat "\n"
|
|
158
|
+
|> sprintf "\n%s"
|
|
159
|
+
|
|
160
|
+
let formatMultiLineList sequence = formatMultiLineCollection ("[", "]") sequence
|
|
161
|
+
|
|
162
|
+
let formatMultiLineArray sequence = formatMultiLineCollection ("[|", "|]") sequence
|
|
163
|
+
|
|
164
|
+
let formatMultiLineSequence sequence = formatMultiLineCollection ("seq {", "}") sequence
|
|
165
|
+
|
|
166
|
+
let formatMultiLineString strings =
|
|
167
|
+
let length = Seq.length strings
|
|
168
|
+
let formatLine i line =
|
|
169
|
+
match i = length - 1 with
|
|
170
|
+
| true -> line
|
|
171
|
+
| false -> sprintf "%s +" line
|
|
172
|
+
|
|
173
|
+
strings
|
|
174
|
+
|> Seq.mapi formatLine
|
|
175
|
+
|> Seq.toList
|
|
176
|
+
|
|
177
|
+
type OutputFilter() =
|
|
178
|
+
static member Format (input: string) = formatValue input
|
|
179
|
+
|
|
180
|
+
static member Indent (input: string) = indent 1 input
|
|
181
|
+
|
|
182
|
+
let private fileSystem = EmbeddedFileSystem(Assembly.GetExecutingAssembly(), "")
|
|
183
|
+
Template.RegisterFilter(OutputFilter().GetType())
|
|
184
|
+
Template.FileSystem <- fileSystem :> DotLiquid.FileSystems.IFileSystem
|
|
185
|
+
|
|
186
|
+
let private registrations = Dictionary<_,_>()
|
|
187
|
+
let rec private registerTypeTree templateDataType =
|
|
188
|
+
if registrations.ContainsKey templateDataType then ()
|
|
189
|
+
elif FSharpType.IsRecord templateDataType then
|
|
190
|
+
let properties = templateDataType.GetProperties(BindingFlags.Instance ||| BindingFlags.Public)
|
|
191
|
+
Template.RegisterSafeType(templateDataType, [| for p in properties -> p.Name |])
|
|
192
|
+
registrations.[templateDataType] <- true
|
|
193
|
+
for p in properties do registerTypeTree p.PropertyType
|
|
194
|
+
elif templateDataType.IsGenericType then
|
|
195
|
+
let t = templateDataType.GetGenericTypeDefinition()
|
|
196
|
+
if t = typedefof<seq<_>> || t = typedefof<list<_>> then
|
|
197
|
+
registrations.[templateDataType] <- true
|
|
198
|
+
registerTypeTree (templateDataType.GetGenericArguments().[0])
|
|
199
|
+
elif t = typedefof<IDictionary<_,_>> || t = typedefof<Map<_,_>> then
|
|
200
|
+
registrations.[templateDataType] <- true
|
|
201
|
+
registerTypeTree (templateDataType.GetGenericArguments().[0])
|
|
202
|
+
registerTypeTree (templateDataType.GetGenericArguments().[1])
|
|
203
|
+
elif t = typedefof<option<_>> then
|
|
204
|
+
Template.RegisterSafeType(templateDataType, [|"Value"; "IsSome"; "IsNone";|])
|
|
205
|
+
registrations.[templateDataType] <- true
|
|
206
|
+
registerTypeTree (templateDataType.GetGenericArguments().[0])
|
|
207
|
+
elif templateDataType.IsArray then
|
|
208
|
+
registrations.[templateDataType] <- true
|
|
209
|
+
registerTypeTree (templateDataType.GetElementType())
|
|
210
|
+
else
|
|
211
|
+
let properties = templateDataType.GetProperties(BindingFlags.Instance ||| BindingFlags.Public)
|
|
212
|
+
Template.RegisterSafeType(templateDataType, [| for p in properties -> p.Name |])
|
|
213
|
+
registrations.[templateDataType] <- true
|
|
214
|
+
for p in properties do registerTypeTree p.PropertyType
|
|
215
|
+
|
|
216
|
+
let renderInlineTemplate template data =
|
|
217
|
+
data.GetType() |> registerTypeTree
|
|
218
|
+
|
|
219
|
+
let parsedTemplate = Template.Parse template
|
|
220
|
+
parsedTemplate.Render(Hash.FromAnonymousObject(data))
|
|
221
|
+
|
|
222
|
+
let renderPartialTemplate templateName data =
|
|
223
|
+
let template = sprintf "{%% include \"%s\" %%}" templateName
|
|
224
|
+
renderInlineTemplate template data
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
module Generators.Program
|
|
2
|
+
|
|
3
|
+
open Serilog
|
|
4
|
+
open Exercise
|
|
5
|
+
open Input
|
|
6
|
+
open Options
|
|
7
|
+
|
|
8
|
+
let regenerateTestClass options =
|
|
9
|
+
let parseCanonicalData' = parseCanonicalData options
|
|
10
|
+
|
|
11
|
+
fun (exercise: Exercise) ->
|
|
12
|
+
let canonicalData = parseCanonicalData' exercise.Name
|
|
13
|
+
exercise.Regenerate(canonicalData)
|
|
14
|
+
|
|
15
|
+
let regenerateTestClasses options =
|
|
16
|
+
Log.Information("Re-generating test classes...")
|
|
17
|
+
|
|
18
|
+
let regenerateTestClass' = regenerateTestClass options
|
|
19
|
+
|
|
20
|
+
createExercises options.Exercises
|
|
21
|
+
|> Seq.iter regenerateTestClass'
|
|
22
|
+
|
|
23
|
+
Log.Information("Re-generated test classes.")
|
|
24
|
+
|
|
25
|
+
[<EntryPoint>]
|
|
26
|
+
let main argv =
|
|
27
|
+
Logging.setupLogger()
|
|
28
|
+
|
|
29
|
+
match parseOptions argv with
|
|
30
|
+
| Result.Ok(options) ->
|
|
31
|
+
regenerateTestClasses options
|
|
32
|
+
0
|
|
33
|
+
| Result.Error(errors) ->
|
|
34
|
+
Log.Error("Error(s) parsing commandline arguments: {Errors}", errors)
|
|
35
|
+
1
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ Sut }} |> should be Empty
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{{ Sut }} |> should equal {{ Expected }}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated based on version {{ Version }} of the canonical data.
|
|
2
|
+
|
|
3
|
+
module {{ TestModuleName }}
|
|
4
|
+
|
|
5
|
+
{%- for namespace in Namespaces -%}
|
|
6
|
+
open {{ namespace }}
|
|
7
|
+
{%- endfor -%}
|
|
8
|
+
|
|
9
|
+
open {{ TestedModuleName }}
|
|
10
|
+
|
|
11
|
+
{%- for method in Methods -%}
|
|
12
|
+
{{ method }}
|
|
13
|
+
{%- endfor -%}
|
data/tracks/go/.travis.yml
CHANGED
|
@@ -18,8 +18,8 @@ sudo: false
|
|
|
18
18
|
# but since Travis only runs five jobs at a time throughout all of Exercism,
|
|
19
19
|
# it is better citizenship to not test the additional versions.
|
|
20
20
|
go:
|
|
21
|
-
- 1.8.
|
|
22
|
-
- 1.
|
|
21
|
+
- 1.8.x
|
|
22
|
+
- 1.x
|
|
23
23
|
- tip
|
|
24
24
|
|
|
25
25
|
# Travis runs in a 64 bit environment but beginning with Go 1.5, building a
|
|
@@ -61,7 +61,7 @@ script:
|
|
|
61
61
|
matrix:
|
|
62
62
|
include:
|
|
63
63
|
# Keep this in sync with the latest version.
|
|
64
|
-
- go: 1.
|
|
64
|
+
- go: 1.x
|
|
65
65
|
env: STATIC_CHECKERS=1
|
|
66
66
|
allow_failures:
|
|
67
67
|
- go: tip
|
|
@@ -13,7 +13,7 @@ This guide might be helpful before you start implementing the exercise: [Porting
|
|
|
13
13
|
It's expected that your code follows the official Style guide: http://groovy-lang.org/style-guide.html
|
|
14
14
|
|
|
15
15
|
### Testing
|
|
16
|
-
Instead of using JUnit we prefer [
|
|
16
|
+
Instead of using JUnit we prefer [Spock](https://github.com/spockframework/spock) ~for consistency~ because it's an awesome framework!
|
|
17
17
|
|
|
18
18
|
## Pull Requests
|
|
19
|
-
It would be awesome if you follow this [simple guidelines](https://github.com/exercism/docs/blob/master/contributing/pull-request-guidelines.md) while creating your PR, but it isn't required.
|
|
19
|
+
It would be awesome if you follow this [simple guidelines](https://github.com/exercism/docs/blob/master/contributing/pull-request-guidelines.md) while creating your PR, but it isn't required.
|
data/tracks/groovy/config.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"language": "Groovy",
|
|
3
3
|
"checklist_issue": 9,
|
|
4
4
|
"active": false,
|
|
5
|
+
"blurb": "Groovy is an unopinionated, multi-paradigm language that enhances Java with the intent to make your code less verbose, yet still allows you utilize the power of the JVM.",
|
|
5
6
|
"test_pattern": "(Spec)[.]groovy",
|
|
6
7
|
"foregone": [
|
|
7
8
|
|
|
@@ -152,6 +153,17 @@
|
|
|
152
153
|
"string manipulation",
|
|
153
154
|
"regular expressions"
|
|
154
155
|
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"uuid": "1d098fb3-0a27-5380-3849-73f2ca77ff2f84ca698",
|
|
159
|
+
"slug": "scrabble-score",
|
|
160
|
+
"core": false,
|
|
161
|
+
"unlocked_by": null,
|
|
162
|
+
"difficulty": 3,
|
|
163
|
+
"topics": [
|
|
164
|
+
"strings",
|
|
165
|
+
"mathematics"
|
|
166
|
+
]
|
|
155
167
|
}
|
|
156
168
|
]
|
|
157
169
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
class ScrabbleScore {
|
|
2
|
+
|
|
3
|
+
static final letterValues = [
|
|
4
|
+
'D': 2, 'G': 2,
|
|
5
|
+
'B': 3, 'C': 3, 'M': 3, 'P': 3,
|
|
6
|
+
'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4,
|
|
7
|
+
'K': 5,
|
|
8
|
+
'J': 8, 'X': 8,
|
|
9
|
+
'Q': 10, 'Z': 10
|
|
10
|
+
].withDefault { 1 }
|
|
11
|
+
|
|
12
|
+
static scoreWord(String word) {
|
|
13
|
+
word.toUpperCase().inject(0) { total, letter ->
|
|
14
|
+
total + letterValues[letter]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
## Scrabble Score
|
|
2
|
+
|
|
3
|
+
Given a word, compute the scrabble score for that word.
|
|
4
|
+
|
|
5
|
+
## Letter Values
|
|
6
|
+
|
|
7
|
+
You'll need these:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Letter Value
|
|
11
|
+
A, E, I, O, U, L, N, R, S, T 1
|
|
12
|
+
D, G 2
|
|
13
|
+
B, C, M, P 3
|
|
14
|
+
F, H, V, W, Y 4
|
|
15
|
+
K 5
|
|
16
|
+
J, X 8
|
|
17
|
+
Q, Z 10
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Examples
|
|
21
|
+
|
|
22
|
+
"cabbage" should be scored as worth 14 points:
|
|
23
|
+
|
|
24
|
+
- 3 points for C
|
|
25
|
+
- 1 point for A, twice
|
|
26
|
+
- 3 points for B, twice
|
|
27
|
+
- 2 points for G
|
|
28
|
+
- 1 point for E
|
|
29
|
+
|
|
30
|
+
And to total:
|
|
31
|
+
|
|
32
|
+
- `3 + 2*1 + 2*3 + 2 + 1`
|
|
33
|
+
- = `3 + 2 + 6 + 3`
|
|
34
|
+
- = `5 + 9`
|
|
35
|
+
- = 14
|
|
36
|
+
|
|
37
|
+
## Extensions
|
|
38
|
+
|
|
39
|
+
- You can play a double or a triple letter.
|
|
40
|
+
- You can play a double or a triple word.
|
|
41
|
+
|
|
42
|
+
## Source
|
|
43
|
+
|
|
44
|
+
Inspired by the Extreme Startup game. [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup)
|
|
45
|
+
|
|
46
|
+
## Need help?
|
|
47
|
+
|
|
48
|
+
For installation and learning resources, refer to the
|
|
49
|
+
[exercism help page](http://exercism.io/languages/groovy).
|
|
50
|
+
|
|
51
|
+
## Running the Tests
|
|
52
|
+
Run the tests by executing the test script.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
$ groovy ./ScrabbleScoreSpec.groovy
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
After the first test(s) pass, continue by commenting out or removing the `@Ignore` annotations on other tests.
|
|
59
|
+
|
|
60
|
+
When all tests pass, congratulations!
|
|
61
|
+
|
|
62
|
+
## Submitting Incomplete Solutions
|
|
63
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@Grab('org.spockframework:spock-core:1.0-groovy-2.4')
|
|
2
|
+
import spock.lang.*
|
|
3
|
+
|
|
4
|
+
class ScrabbleScoreSpec extends Specification {
|
|
5
|
+
|
|
6
|
+
def 'lowercase letter'() {
|
|
7
|
+
expect:
|
|
8
|
+
ScrabbleScore.scoreWord('a') == 1
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
def 'uppercase letter'() {
|
|
12
|
+
expect:
|
|
13
|
+
ScrabbleScore.scoreWord('A') == 1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
def 'valuable letter'() {
|
|
17
|
+
expect:
|
|
18
|
+
ScrabbleScore.scoreWord('f') == 4
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
def 'empty input'() {
|
|
22
|
+
expect:
|
|
23
|
+
ScrabbleScore.scoreWord('') == 0
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@Unroll
|
|
27
|
+
def 'score for word #word should be #expectedScore'() {
|
|
28
|
+
when:
|
|
29
|
+
def score = ScrabbleScore.scoreWord(word)
|
|
30
|
+
|
|
31
|
+
then:
|
|
32
|
+
score == expectedScore
|
|
33
|
+
|
|
34
|
+
where:
|
|
35
|
+
word | expectedScore
|
|
36
|
+
'at' | 2
|
|
37
|
+
'zoo' | 12
|
|
38
|
+
'street' | 6
|
|
39
|
+
'quirky' | 22
|
|
40
|
+
'OxyphenButazone' | 41
|
|
41
|
+
'pinata' | 8
|
|
42
|
+
'abcdefghijklmnopqrstuvwxyz' | 87
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
@@ -71,7 +71,7 @@ one, head over there and create an issue. We'll do our best to help you!
|
|
|
71
71
|
|
|
72
72
|
## Source
|
|
73
73
|
|
|
74
|
-
Software Craftsmanship - Kata
|
|
74
|
+
Software Craftsmanship - Coin Change Kata [https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata](https://web.archive.org/web/20130115115225/http://craftsmanship.sv.cmu.edu:80/exercises/coin-change-kata)
|
|
75
75
|
|
|
76
76
|
## Submitting Incomplete Solutions
|
|
77
77
|
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|