trackler 2.2.1.128 → 2.2.1.129
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/bracket-push/canonical-data.json +9 -1
- data/tracks/bash/config.json +3 -3
- data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +3 -1
- data/tracks/crystal/exercises/difference-of-squares/spec/difference_of_squares_spec.cr +9 -9
- data/tracks/csharp/config.json +12 -0
- data/tracks/csharp/exercises/Exercises.sln +7 -1
- data/tracks/csharp/exercises/yacht/Example.cs +71 -0
- data/tracks/csharp/exercises/yacht/README.md +34 -0
- data/tracks/csharp/exercises/yacht/Yacht.cs +26 -0
- data/tracks/csharp/exercises/yacht/Yacht.csproj +18 -0
- data/tracks/csharp/exercises/yacht/YachtTest.cs +162 -0
- data/tracks/csharp/generators/Exercises/Yacht.cs +20 -0
- data/tracks/dart/exercises/leap/lib/example.dart +4 -8
- data/tracks/dart/exercises/leap/lib/leap.dart +1 -1
- data/tracks/dart/exercises/leap/test/leap_test.dart +14 -16
- data/tracks/delphi/config.json +11 -0
- data/tracks/delphi/exercises/bracket-push/BracketPush.dpr +60 -0
- data/tracks/delphi/exercises/bracket-push/README.md +31 -0
- data/tracks/delphi/exercises/bracket-push/uBracketPushExample.pas +40 -0
- data/tracks/delphi/exercises/bracket-push/uBracketPushTest.pas +158 -0
- data/tracks/fsharp/config.json +18 -6
- data/tracks/fsharp/exercises/Exercises.sln +7 -1
- data/tracks/fsharp/exercises/accumulate/Accumulate.fsproj +2 -2
- data/tracks/fsharp/exercises/acronym/Acronym.fsproj +2 -2
- data/tracks/fsharp/exercises/all-your-base/AllYourBase.fsproj +2 -2
- data/tracks/fsharp/exercises/allergies/Allergies.fsproj +2 -2
- data/tracks/fsharp/exercises/alphametics/Alphametics.fsproj +2 -2
- data/tracks/fsharp/exercises/anagram/Anagram.fsproj +2 -2
- data/tracks/fsharp/exercises/armstrong-numbers/ArmstrongNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/atbash-cipher/AtbashCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/bank-account/BankAccount.fsproj +2 -2
- data/tracks/fsharp/exercises/beer-song/BeerSong.fsproj +2 -2
- data/tracks/fsharp/exercises/binary/Binary.fsproj +2 -2
- data/tracks/fsharp/exercises/binary-search/BinarySearch.fsproj +2 -2
- data/tracks/fsharp/exercises/binary-search-tree/BinarySearchTree.fsproj +2 -2
- data/tracks/fsharp/exercises/bob/Bob.fsproj +2 -2
- data/tracks/fsharp/exercises/book-store/BookStore.fsproj +2 -2
- data/tracks/fsharp/exercises/bowling/Bowling.fsproj +2 -2
- data/tracks/fsharp/exercises/bowling/BowlingTest.fs +15 -1
- data/tracks/fsharp/exercises/bracket-push/BracketPush.fsproj +2 -2
- data/tracks/fsharp/exercises/change/Change.fsproj +2 -2
- data/tracks/fsharp/exercises/circular-buffer/CircularBuffer.fsproj +2 -2
- data/tracks/fsharp/exercises/circular-buffer/CircularBufferTest.fs +1 -1
- data/tracks/fsharp/exercises/clock/Clock.fsproj +2 -2
- data/tracks/fsharp/exercises/collatz-conjecture/CollatzConjecture.fsproj +2 -2
- data/tracks/fsharp/exercises/complex-numbers/ComplexNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/connect/Connect.fsproj +2 -2
- data/tracks/fsharp/exercises/crypto-square/CryptoSquare.fsproj +2 -2
- data/tracks/fsharp/exercises/custom-set/CustomSet.fsproj +2 -2
- data/tracks/fsharp/exercises/diamond/Diamond.fsproj +2 -2
- data/tracks/fsharp/exercises/difference-of-squares/DifferenceOfSquares.fsproj +2 -2
- data/tracks/fsharp/exercises/diffie-hellman/DiffieHellman.fsproj +2 -2
- data/tracks/fsharp/exercises/dominoes/Dominoes.fsproj +2 -2
- data/tracks/fsharp/exercises/dot-dsl/DotDsl.fsproj +2 -2
- data/tracks/fsharp/exercises/error-handling/ErrorHandling.fsproj +2 -2
- data/tracks/fsharp/exercises/etl/Etl.fsproj +2 -2
- data/tracks/fsharp/exercises/food-chain/FoodChain.fsproj +2 -2
- data/tracks/fsharp/exercises/forth/Forth.fsproj +2 -2
- data/tracks/fsharp/exercises/forth/ForthTest.fs +1 -1
- data/tracks/fsharp/exercises/gigasecond/Gigasecond.fsproj +2 -2
- data/tracks/fsharp/exercises/go-counting/GoCounting.fsproj +2 -2
- data/tracks/fsharp/exercises/grade-school/GradeSchool.fsproj +2 -2
- data/tracks/fsharp/exercises/grains/Grains.fsproj +2 -2
- data/tracks/fsharp/exercises/grains/GrainsTest.fs +1 -1
- data/tracks/fsharp/exercises/grep/Grep.fsproj +2 -2
- data/tracks/fsharp/exercises/grep/GrepTest.fs +1 -1
- data/tracks/fsharp/exercises/hamming/Hamming.fsproj +2 -2
- data/tracks/fsharp/exercises/hangman/Hangman.fsproj +2 -2
- data/tracks/fsharp/exercises/hello-world/HelloWorld.fsproj +2 -2
- data/tracks/fsharp/exercises/hexadecimal/Hexadecimal.fsproj +2 -2
- data/tracks/fsharp/exercises/house/Example.fs +2 -2
- data/tracks/fsharp/exercises/house/House.fsproj +2 -2
- data/tracks/fsharp/exercises/house/HouseTest.fs +28 -211
- data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifier.fsproj +2 -2
- data/tracks/fsharp/exercises/isbn-verifier/IsbnVerifierTest.fs +2 -2
- data/tracks/fsharp/exercises/isogram/Isogram.fsproj +2 -2
- data/tracks/fsharp/exercises/isogram/IsogramTest.fs +1 -1
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGarden.fsproj +2 -2
- data/tracks/fsharp/exercises/largest-series-product/LargestSeriesProduct.fsproj +2 -2
- data/tracks/fsharp/exercises/leap/Leap.fsproj +2 -2
- data/tracks/fsharp/exercises/ledger/Ledger.fsproj +2 -2
- data/tracks/fsharp/exercises/lens-person/LensPerson.fsproj +2 -2
- data/tracks/fsharp/exercises/linked-list/LinkedList.fsproj +2 -2
- data/tracks/fsharp/exercises/list-ops/ListOps.fsproj +2 -2
- data/tracks/fsharp/exercises/list-ops/ListOpsTest.fs +1 -1
- data/tracks/fsharp/exercises/luhn/Luhn.fsproj +2 -2
- data/tracks/fsharp/exercises/markdown/Markdown.fsproj +2 -2
- data/tracks/fsharp/exercises/matrix/Matrix.fsproj +2 -2
- data/tracks/fsharp/exercises/meetup/Meetup.fsproj +2 -2
- data/tracks/fsharp/exercises/minesweeper/Minesweeper.fsproj +2 -2
- data/tracks/fsharp/exercises/nth-prime/NthPrime.fsproj +2 -2
- data/tracks/fsharp/exercises/nucleotide-count/NucleotideCount.fsproj +2 -2
- data/tracks/fsharp/exercises/ocr-numbers/OcrNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/octal/Octal.fsproj +2 -2
- data/tracks/fsharp/exercises/palindrome-products/PalindromeProducts.fsproj +2 -2
- data/tracks/fsharp/exercises/pangram/Pangram.fsproj +2 -2
- data/tracks/fsharp/exercises/parallel-letter-frequency/ParallelLetterFrequency.fsproj +2 -2
- data/tracks/fsharp/exercises/pascals-triangle/PascalsTriangle.fsproj +2 -2
- data/tracks/fsharp/exercises/perfect-numbers/PerfectNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/phone-number/PhoneNumber.fsproj +2 -2
- data/tracks/fsharp/exercises/pig-latin/PigLatin.fsproj +2 -2
- data/tracks/fsharp/exercises/poker/Poker.fsproj +2 -2
- data/tracks/fsharp/exercises/pov/Pov.fsproj +2 -2
- data/tracks/fsharp/exercises/pov/PovTest.fs +2 -2
- data/tracks/fsharp/exercises/prime-factors/PrimeFactors.fsproj +2 -2
- data/tracks/fsharp/exercises/protein-translation/ProteinTranslation.fsproj +2 -2
- data/tracks/fsharp/exercises/proverb/Proverb.fsproj +2 -2
- data/tracks/fsharp/exercises/pythagorean-triplet/PythagoreanTriplet.fsproj +2 -2
- data/tracks/fsharp/exercises/queen-attack/QueenAttack.fsproj +2 -2
- data/tracks/fsharp/exercises/rail-fence-cipher/RailFenceCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/raindrops/Raindrops.fsproj +2 -2
- data/tracks/fsharp/exercises/rational-numbers/RationalNumbers.fsproj +2 -2
- data/tracks/fsharp/exercises/react/Example.fs +1 -1
- data/tracks/fsharp/exercises/react/React.fsproj +2 -2
- data/tracks/fsharp/exercises/react/ReactTest.fs +14 -1
- data/tracks/fsharp/exercises/rectangles/Rectangles.fsproj +2 -2
- data/tracks/fsharp/exercises/reverse-string/ReverseString.fsproj +2 -2
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscription.fsproj +2 -2
- data/tracks/fsharp/exercises/robot-name/RobotName.fsproj +2 -2
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fsproj +2 -2
- data/tracks/fsharp/exercises/roman-numerals/RomanNumerals.fsproj +2 -2
- data/tracks/fsharp/exercises/rotational-cipher/RotationalCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/run-length-encoding/RunLengthEncoding.fsproj +2 -2
- data/tracks/fsharp/exercises/saddle-points/SaddlePoints.fsproj +2 -2
- data/tracks/fsharp/exercises/say/Say.fsproj +2 -2
- data/tracks/fsharp/exercises/scale-generator/ScaleGenerator.fsproj +2 -2
- data/tracks/fsharp/exercises/scrabble-score/ScrabbleScore.fsproj +2 -2
- data/tracks/fsharp/exercises/secret-handshake/SecretHandshake.fsproj +2 -2
- data/tracks/fsharp/exercises/series/Series.fsproj +2 -2
- data/tracks/fsharp/exercises/sgf-parsing/SgfParsing.fsproj +2 -2
- data/tracks/fsharp/exercises/sieve/Sieve.fsproj +2 -2
- data/tracks/fsharp/exercises/simple-cipher/SimpleCipher.fsproj +2 -2
- data/tracks/fsharp/exercises/simple-linked-list/SimpleLinkedList.fsproj +2 -2
- data/tracks/fsharp/exercises/space-age/SpaceAge.fsproj +2 -2
- data/tracks/fsharp/exercises/spiral-matrix/SpiralMatrix.fsproj +2 -2
- data/tracks/fsharp/exercises/strain/Strain.fsproj +2 -2
- data/tracks/fsharp/exercises/sublist/Sublist.fsproj +2 -2
- data/tracks/fsharp/exercises/sum-of-multiples/SumOfMultiples.fsproj +2 -2
- data/tracks/fsharp/exercises/tournament/Tournament.fsproj +2 -2
- data/tracks/fsharp/exercises/transpose/Transpose.fsproj +2 -2
- data/tracks/fsharp/exercises/tree-building/TreeBuilding.fsproj +2 -2
- data/tracks/fsharp/exercises/triangle/Triangle.fsproj +2 -2
- data/tracks/fsharp/exercises/trinary/Trinary.fsproj +2 -2
- data/tracks/fsharp/exercises/twelve-days/TwelveDays.fsproj +2 -2
- data/tracks/fsharp/exercises/two-bucket/TwoBucket.fsproj +2 -2
- data/tracks/fsharp/exercises/two-fer/TwoFer.fsproj +2 -2
- data/tracks/fsharp/exercises/variable-length-quantity/VariableLengthQuantity.fsproj +2 -2
- data/tracks/fsharp/exercises/word-count/WordCount.fsproj +2 -2
- data/tracks/fsharp/exercises/word-search/WordSearch.fsproj +2 -2
- data/tracks/fsharp/exercises/word-search/WordSearchTest.fs +1 -1
- data/tracks/fsharp/exercises/wordy/Wordy.fsproj +2 -2
- data/tracks/fsharp/exercises/yacht/Example.fs +65 -0
- data/tracks/fsharp/exercises/yacht/Program.fs +1 -0
- data/tracks/fsharp/exercises/yacht/README.md +34 -0
- data/tracks/fsharp/exercises/yacht/Yacht.fs +17 -0
- data/tracks/fsharp/exercises/yacht/Yacht.fsproj +23 -0
- data/tracks/fsharp/exercises/yacht/YachtTest.fs +113 -0
- data/tracks/fsharp/exercises/zebra-puzzle/ZebraPuzzle.fsproj +2 -2
- data/tracks/fsharp/exercises/zipper/Zipper.fsproj +2 -2
- data/tracks/fsharp/generators/CanonicalData.fs +2 -20
- data/tracks/fsharp/generators/Common.fs +1 -1
- data/tracks/fsharp/generators/Generators.fs +24 -11
- data/tracks/fsharp/generators/Generators.fsproj +4 -4
- data/tracks/fsharp/generators/Options.fs +1 -1
- data/tracks/haskell/exercises/bracket-push/package.yaml +1 -1
- data/tracks/haskell/exercises/bracket-push/test/Tests.hs +4 -0
- data/tracks/java/config.json +13 -0
- data/tracks/java/exercises/dominoes/.meta/src/reference/java/ChainNotFoundException.java +5 -0
- data/tracks/java/exercises/dominoes/.meta/src/reference/java/Domino.java +30 -0
- data/tracks/java/exercises/dominoes/.meta/src/reference/java/Dominoes.java +67 -0
- data/tracks/java/exercises/dominoes/.meta/version +2 -0
- data/tracks/java/exercises/dominoes/README.md +29 -0
- data/tracks/java/exercises/dominoes/build.gradle +18 -0
- data/tracks/java/exercises/dominoes/src/main/java/ChainNotFoundException.java +5 -0
- data/tracks/java/exercises/dominoes/src/main/java/Domino.java +30 -0
- data/tracks/java/exercises/dominoes/src/test/java/DominoesTest.java +230 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/javascript/.eslintignore +0 -1
- data/tracks/javascript/exercises/simple-cipher/example.js +4 -6
- data/tracks/javascript/exercises/simple-cipher/simple-cipher.spec.js +7 -3
- data/tracks/php/config.json +7 -7
- data/tracks/python/config.json +195 -188
- data/tracks/python/exercises/alphametics/alphametics_test.py +1 -0
- data/tracks/python/exercises/bank-account/README.md +20 -1
- data/tracks/python/exercises/go-counting/README.md +2 -0
- data/tracks/python/test/check-exercises.py +1 -1
- data/tracks/rust/_test/ensure-stubs-compile.sh +5 -0
- data/tracks/rust/config/exercise_readme.go.tmpl +1 -1
- data/tracks/rust/config.json +10 -0
- data/tracks/rust/exercises/accumulate/README.md +1 -1
- data/tracks/rust/exercises/acronym/README.md +1 -1
- data/tracks/rust/exercises/all-your-base/README.md +1 -1
- data/tracks/rust/exercises/all-your-base/example.rs +15 -5
- data/tracks/rust/exercises/all-your-base/src/lib.rs +8 -1
- data/tracks/rust/exercises/all-your-base/tests/all-your-base.rs +10 -5
- data/tracks/rust/exercises/allergies/README.md +1 -1
- data/tracks/rust/exercises/alphametics/README.md +1 -1
- data/tracks/rust/exercises/anagram/README.md +1 -1
- data/tracks/rust/exercises/armstrong-numbers/.gitignore +3 -0
- data/tracks/rust/exercises/armstrong-numbers/Cargo.toml +3 -0
- data/tracks/rust/exercises/armstrong-numbers/README.md +51 -0
- data/tracks/rust/exercises/armstrong-numbers/example.rs +7 -0
- data/tracks/rust/exercises/armstrong-numbers/src/lib.rs +3 -0
- data/tracks/rust/exercises/armstrong-numbers/tests/armstrong-numbers.rs +49 -0
- data/tracks/rust/exercises/atbash-cipher/README.md +1 -1
- data/tracks/rust/exercises/beer-song/README.md +1 -1
- data/tracks/rust/exercises/binary-search/README.md +1 -1
- data/tracks/rust/exercises/bob/README.md +1 -1
- data/tracks/rust/exercises/book-store/README.md +1 -1
- data/tracks/rust/exercises/bowling/README.md +1 -1
- data/tracks/rust/exercises/bowling/example.rs +13 -8
- data/tracks/rust/exercises/bowling/src/lib.rs +22 -0
- data/tracks/rust/exercises/bowling/tests/bowling.rs +31 -31
- data/tracks/rust/exercises/bracket-push/README.md +1 -1
- data/tracks/rust/exercises/circular-buffer/README.md +1 -1
- data/tracks/rust/exercises/clock/README.md +1 -1
- data/tracks/rust/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/rust/exercises/crypto-square/README.md +1 -1
- data/tracks/rust/exercises/crypto-square/example.rs +11 -3
- data/tracks/rust/exercises/crypto-square/tests/crypto-square.rs +8 -16
- data/tracks/rust/exercises/custom-set/README.md +1 -1
- data/tracks/rust/exercises/custom-set/example.rs +17 -17
- data/tracks/rust/exercises/custom-set/tests/custom-set.rs +84 -84
- data/tracks/rust/exercises/decimal/README.md +1 -1
- data/tracks/rust/exercises/difference-of-squares/README.md +1 -1
- data/tracks/rust/exercises/diffie-hellman/README.md +1 -1
- data/tracks/rust/exercises/dominoes/README.md +1 -1
- data/tracks/rust/exercises/etl/README.md +1 -1
- data/tracks/rust/exercises/forth/README.md +1 -1
- data/tracks/rust/exercises/gigasecond/README.md +1 -1
- data/tracks/rust/exercises/grade-school/README.md +1 -1
- data/tracks/rust/exercises/grains/README.md +1 -1
- data/tracks/rust/exercises/hamming/README.md +1 -1
- data/tracks/rust/exercises/hello-world/README.md +1 -1
- data/tracks/rust/exercises/hexadecimal/README.md +1 -1
- data/tracks/rust/exercises/isbn-verifier/README.md +1 -1
- data/tracks/rust/exercises/isogram/README.md +1 -1
- data/tracks/rust/exercises/largest-series-product/README.md +1 -1
- data/tracks/rust/exercises/largest-series-product/example.rs +10 -4
- data/tracks/rust/exercises/largest-series-product/src/lib.rs +9 -0
- data/tracks/rust/exercises/largest-series-product/tests/largest-series-product.rs +3 -3
- data/tracks/rust/exercises/leap/README.md +1 -1
- data/tracks/rust/exercises/luhn/README.md +1 -1
- data/tracks/rust/exercises/luhn-from/README.md +1 -1
- data/tracks/rust/exercises/luhn-trait/README.md +1 -1
- data/tracks/rust/exercises/macros/.meta/ALLOWED_TO_NOT_COMPILE +2 -0
- data/tracks/rust/exercises/macros/README.md +1 -1
- data/tracks/rust/exercises/minesweeper/README.md +1 -1
- data/tracks/rust/exercises/nth-prime/README.md +1 -1
- data/tracks/rust/exercises/nucleotide-codons/README.md +1 -1
- data/tracks/rust/exercises/nucleotide-count/README.md +1 -1
- data/tracks/rust/exercises/ocr-numbers/README.md +1 -1
- data/tracks/rust/exercises/ocr-numbers/example.rs +14 -6
- data/tracks/rust/exercises/ocr-numbers/src/lib.rs +7 -1
- data/tracks/rust/exercises/ocr-numbers/tests/ocr-numbers.rs +2 -2
- data/tracks/rust/exercises/pangram/README.md +1 -1
- data/tracks/rust/exercises/parallel-letter-frequency/README.md +1 -1
- data/tracks/rust/exercises/pascals-triangle/README.md +1 -1
- data/tracks/rust/exercises/perfect-numbers/README.md +1 -1
- data/tracks/rust/exercises/phone-number/README.md +1 -1
- data/tracks/rust/exercises/pig-latin/README.md +1 -1
- data/tracks/rust/exercises/poker/README.md +1 -1
- data/tracks/rust/exercises/prime-factors/README.md +1 -1
- data/tracks/rust/exercises/protein-translation/README.md +1 -1
- data/tracks/rust/exercises/proverb/README.md +1 -1
- data/tracks/rust/exercises/pythagorean-triplet/README.md +1 -1
- data/tracks/rust/exercises/queen-attack/README.md +1 -1
- data/tracks/rust/exercises/raindrops/README.md +1 -1
- data/tracks/rust/exercises/react/README.md +1 -1
- data/tracks/rust/exercises/react/example.rs +27 -18
- data/tracks/rust/exercises/react/src/lib.rs +25 -10
- data/tracks/rust/exercises/react/tests/react.rs +113 -83
- data/tracks/rust/exercises/rectangles/README.md +1 -1
- data/tracks/rust/exercises/reverse-string/README.md +1 -1
- data/tracks/rust/exercises/rna-transcription/README.md +1 -1
- data/tracks/rust/exercises/robot-name/README.md +1 -1
- data/tracks/rust/exercises/robot-simulator/README.md +1 -1
- data/tracks/rust/exercises/roman-numerals/README.md +1 -1
- data/tracks/rust/exercises/rotational-cipher/README.md +1 -1
- data/tracks/rust/exercises/run-length-encoding/README.md +1 -1
- data/tracks/rust/exercises/saddle-points/README.md +1 -1
- data/tracks/rust/exercises/say/README.md +1 -1
- data/tracks/rust/exercises/scrabble-score/README.md +1 -1
- data/tracks/rust/exercises/series/README.md +1 -1
- data/tracks/rust/exercises/sieve/README.md +1 -1
- data/tracks/rust/exercises/simple-linked-list/README.md +1 -1
- data/tracks/rust/exercises/space-age/README.md +1 -1
- data/tracks/rust/exercises/sublist/README.md +1 -1
- data/tracks/rust/exercises/sum-of-multiples/README.md +1 -1
- data/tracks/rust/exercises/tournament/README.md +1 -1
- data/tracks/rust/exercises/triangle/README.md +1 -1
- data/tracks/rust/exercises/two-bucket/README.md +1 -1
- data/tracks/rust/exercises/variable-length-quantity/README.md +1 -1
- data/tracks/rust/exercises/word-count/README.md +1 -1
- data/tracks/rust/exercises/wordy/README.md +1 -1
- data/tracks/typescript/config.json +11 -0
- data/tracks/typescript/exercises/list-ops/README.md +35 -0
- data/tracks/typescript/exercises/list-ops/list-ops.example.ts +80 -0
- data/tracks/typescript/exercises/list-ops/list-ops.test.ts +117 -0
- data/tracks/typescript/exercises/list-ops/list-ops.ts +0 -0
- data/tracks/typescript/exercises/list-ops/package.json +36 -0
- data/tracks/typescript/exercises/list-ops/tsconfig.json +22 -0
- data/tracks/typescript/exercises/list-ops/tslint.json +127 -0
- data/tracks/typescript/exercises/list-ops/yarn.lock +2624 -0
- metadata +42 -3
- data/tracks/dart/exercises/leap/pubspec.lock +0 -293
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb29fe65c3ecd5e8a634ddabb722ee8bf9853f3e
|
4
|
+
data.tar.gz: 3fe12ee29a4011a03cf539696880996e05b38148
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 741a5f089384c1fdfde42dd6d158d43ff503b306cca392668ebddb3eb05db9a4d0ef16ad78379594dbf7dc8be5a8316c7d4977e2c461ed0d3900bed1707520d3
|
7
|
+
data.tar.gz: cb32027c2fbe7646481eb4a19ea399b05183dd3b9d8f1ca1bbbe21c1f7ee5d42d2d0b8a5cc8b4c41d5479bc993bc0202b7d6f56504349314fe7717bc3e19f78c
|
data/lib/trackler/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"exercise": "bracket-push",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.3.0",
|
4
4
|
"cases": [
|
5
5
|
{
|
6
6
|
"description": "paired square brackets",
|
@@ -50,6 +50,14 @@
|
|
50
50
|
},
|
51
51
|
"expected": true
|
52
52
|
},
|
53
|
+
{
|
54
|
+
"description": "partially paired brackets",
|
55
|
+
"property": "isPaired",
|
56
|
+
"input": {
|
57
|
+
"value": "{[])"
|
58
|
+
},
|
59
|
+
"expected": false
|
60
|
+
},
|
53
61
|
{
|
54
62
|
"description": "simple nested brackets",
|
55
63
|
"property": "isPaired",
|
data/tracks/bash/config.json
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
"strings",
|
34
34
|
"text_formatting"
|
35
35
|
],
|
36
|
-
"unlocked_by":
|
36
|
+
"unlocked_by": null,
|
37
37
|
"uuid": "0cfac255-6871-4588-a16b-98f7692bfdbe"
|
38
38
|
},
|
39
39
|
{
|
@@ -91,7 +91,7 @@
|
|
91
91
|
"stdout",
|
92
92
|
"strings"
|
93
93
|
],
|
94
|
-
"unlocked_by":
|
94
|
+
"unlocked_by": null,
|
95
95
|
"uuid": "b2b4ee35-108f-45ce-b294-c10d332e5579"
|
96
96
|
},
|
97
97
|
{
|
@@ -113,7 +113,7 @@
|
|
113
113
|
"control_flow_conditionals",
|
114
114
|
"input_validation"
|
115
115
|
],
|
116
|
-
"unlocked_by":
|
116
|
+
"unlocked_by": null,
|
117
117
|
"uuid": "e24451fd-761d-4d20-81d9-e470486ec44a"
|
118
118
|
},
|
119
119
|
{
|
@@ -2,7 +2,7 @@ import ceylon.test {
|
|
2
2
|
...
|
3
3
|
}
|
4
4
|
|
5
|
-
// Tests adapted from problem-specifications version 1.
|
5
|
+
// Tests adapted from problem-specifications version 1.3.0
|
6
6
|
|
7
7
|
{[String, Boolean]*} cases => {
|
8
8
|
// paired square brackets
|
@@ -17,6 +17,8 @@ import ceylon.test {
|
|
17
17
|
["{]", false],
|
18
18
|
// paired with whitespace
|
19
19
|
["{ }", true],
|
20
|
+
// partially paired brackets
|
21
|
+
["{[])", false],
|
20
22
|
// simple nested brackets
|
21
23
|
["{[]}", true],
|
22
24
|
// several paired brackets
|
@@ -6,39 +6,39 @@ describe "DifferenceOfSquares" do
|
|
6
6
|
Squares.square_of_sum(5).should eq(225)
|
7
7
|
end
|
8
8
|
|
9
|
-
|
9
|
+
pending "calculates square of sum 10 is 3025" do
|
10
10
|
Squares.square_of_sum(10).should eq(3025)
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
pending "calculates square of sum 100 is 25502500" do
|
14
14
|
Squares.square_of_sum(100).should eq(25502500)
|
15
15
|
end
|
16
16
|
|
17
|
-
|
17
|
+
pending "calculates sum of squares 5 is 55" do
|
18
18
|
Squares.sum_of_squares(5).should eq(55)
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
pending "calculates sum of squares 10 is 385" do
|
22
22
|
Squares.sum_of_squares(10).should eq(385)
|
23
23
|
end
|
24
24
|
|
25
|
-
|
25
|
+
pending "calculates sum of squares 100 is 338350" do
|
26
26
|
Squares.sum_of_squares(100).should eq(338350)
|
27
27
|
end
|
28
28
|
|
29
|
-
|
29
|
+
pending "calculates difference of squares 0 is 0" do
|
30
30
|
Squares.difference_of_squares(0).should eq(0)
|
31
31
|
end
|
32
32
|
|
33
|
-
|
33
|
+
pending "calculates difference of squares 5 is 170" do
|
34
34
|
Squares.difference_of_squares(5).should eq(170)
|
35
35
|
end
|
36
36
|
|
37
|
-
|
37
|
+
pending "calculates difference of squares 10 is 2640" do
|
38
38
|
Squares.difference_of_squares(10).should eq(2640)
|
39
39
|
end
|
40
40
|
|
41
|
-
|
41
|
+
pending "calculates difference of squares 100 is 25164150" do
|
42
42
|
Squares.difference_of_squares(100).should eq(25164150)
|
43
43
|
end
|
44
44
|
end
|
data/tracks/csharp/config.json
CHANGED
@@ -926,6 +926,18 @@
|
|
926
926
|
"unlocked_by": "kindergarten-garden",
|
927
927
|
"uuid": "bae1f3a4-b63d-4efd-921a-133b3d5e379c"
|
928
928
|
},
|
929
|
+
{
|
930
|
+
"core": false,
|
931
|
+
"difficulty": 5,
|
932
|
+
"slug": "yacht",
|
933
|
+
"topics": [
|
934
|
+
"games",
|
935
|
+
"parsing",
|
936
|
+
"sorting"
|
937
|
+
],
|
938
|
+
"unlocked_by": "bob",
|
939
|
+
"uuid": "f808e80a-8e76-4f3d-840e-31a840c560f2"
|
940
|
+
},
|
929
941
|
{
|
930
942
|
"core": false,
|
931
943
|
"difficulty": 6,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
2
2
|
# Visual Studio 15
|
3
|
-
VisualStudioVersion = 15.0.
|
3
|
+
VisualStudioVersion = 15.0.26730.12
|
4
4
|
MinimumVisualStudioVersion = 15.0.26124.0
|
5
5
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accumulate", "accumulate\Accumulate.csproj", "{F16C0EE1-6923-4328-B015-363CF24FF867}"
|
6
6
|
EndProject
|
@@ -226,6 +226,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReverseString", "reverse-st
|
|
226
226
|
EndProject
|
227
227
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ArmstrongNumbers", "armstrong-numbers\ArmstrongNumbers.csproj", "{7015C2C4-4050-4631-9394-7EAF19AB0191}"
|
228
228
|
EndProject
|
229
|
+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Yacht", "yacht\Yacht.csproj", "{C029D4C6-3A10-459E-96D7-3E77170A5A10}"
|
230
|
+
EndProject
|
229
231
|
Global
|
230
232
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
231
233
|
Debug|Any CPU = Debug|Any CPU
|
@@ -680,6 +682,10 @@ Global
|
|
680
682
|
{7015C2C4-4050-4631-9394-7EAF19AB0191}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
681
683
|
{7015C2C4-4050-4631-9394-7EAF19AB0191}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
682
684
|
{7015C2C4-4050-4631-9394-7EAF19AB0191}.Release|Any CPU.Build.0 = Release|Any CPU
|
685
|
+
{C029D4C6-3A10-459E-96D7-3E77170A5A10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
686
|
+
{C029D4C6-3A10-459E-96D7-3E77170A5A10}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
687
|
+
{C029D4C6-3A10-459E-96D7-3E77170A5A10}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
688
|
+
{C029D4C6-3A10-459E-96D7-3E77170A5A10}.Release|Any CPU.Build.0 = Release|Any CPU
|
683
689
|
EndGlobalSection
|
684
690
|
GlobalSection(SolutionProperties) = preSolution
|
685
691
|
HideSolutionNode = FALSE
|
@@ -0,0 +1,71 @@
|
|
1
|
+
using System.Collections.Generic;
|
2
|
+
using System.Linq;
|
3
|
+
|
4
|
+
public enum YachtCategory
|
5
|
+
{
|
6
|
+
Ones = 1,
|
7
|
+
Twos = 2,
|
8
|
+
Threes = 3,
|
9
|
+
Fours = 4,
|
10
|
+
Fives = 5,
|
11
|
+
Sixes = 6,
|
12
|
+
FullHouse = 7,
|
13
|
+
FourOfAKind = 8,
|
14
|
+
LittleStraight = 9,
|
15
|
+
BigStraight = 10,
|
16
|
+
Choice = 11,
|
17
|
+
Yacht = 12,
|
18
|
+
}
|
19
|
+
|
20
|
+
public static class YachtGame
|
21
|
+
{
|
22
|
+
public static int Score(int[] dice, YachtCategory category)
|
23
|
+
{
|
24
|
+
switch (category)
|
25
|
+
{
|
26
|
+
//Ones: Any combination. The sum of dice with the number 1.
|
27
|
+
case YachtCategory.Ones: return dice.Where(x => x == 1).Sum();
|
28
|
+
//Twos: Any combination. The sum of dice with the number 2.
|
29
|
+
case YachtCategory.Twos: return dice.Where(x => x == 2).Sum();
|
30
|
+
//Threes: Any combination. The sum of dice with the number 3.
|
31
|
+
case YachtCategory.Threes: return dice.Where(x => x == 3).Sum();
|
32
|
+
//Fours: Any combination The sum of dice with the number 4.
|
33
|
+
case YachtCategory.Fours: return dice.Where(x => x == 4).Sum();
|
34
|
+
//Fives: Any combination. The sum of dice with the number 5.
|
35
|
+
case YachtCategory.Fives: return dice.Where(x => x == 5).Sum();
|
36
|
+
//Sixes: Any combination. The sum of dice with the number 6.
|
37
|
+
case YachtCategory.Sixes: return dice.Where(x => x == 6).Sum();
|
38
|
+
|
39
|
+
//Full House: Three of one number and two of another. Sum of all dice.
|
40
|
+
case YachtCategory.FullHouse:
|
41
|
+
{
|
42
|
+
var testHashSet = new HashSet<int>();
|
43
|
+
dice.ToList().ForEach(x => testHashSet.Add(x));
|
44
|
+
return (testHashSet.Count() == 2) ? dice.Sum() : 0;
|
45
|
+
}
|
46
|
+
//Four-Of-A-Kind: At least four dice showing the same face. Sum of those four dice.
|
47
|
+
case YachtCategory.FourOfAKind:
|
48
|
+
var testDict = new Dictionary<int, int>();
|
49
|
+
dice.ToList().ForEach(x =>
|
50
|
+
{
|
51
|
+
if (!testDict.ContainsKey(x)) testDict.Add(x, 1); else testDict[x]++;
|
52
|
+
});
|
53
|
+
if (testDict.Count > 2) return 0;
|
54
|
+
else if (testDict.Count == 1 || testDict.ElementAt(0).Value >= 4) return testDict.Keys.ElementAt(0) * 4;
|
55
|
+
else if (testDict.ElementAt(1).Value >= 4) return testDict.Keys.ElementAt(1) * 4;
|
56
|
+
else return 0;
|
57
|
+
//Little Straight: 1 - 2 - 3 - 4 - 5. Score varies. Often 30.
|
58
|
+
case YachtCategory.LittleStraight:
|
59
|
+
return dice.OrderBy(x => x).SequenceEqual(new[] { 1, 2, 3, 4, 5 }) ? 30 : 0;
|
60
|
+
//Big Straight: 2 - 3 - 4 - 5 - 6. Score varies. Often 30.
|
61
|
+
case YachtCategory.BigStraight:
|
62
|
+
return dice.OrderBy(x => x).SequenceEqual(new[] { 2, 3, 4, 5, 6 }) ? 30 : 0;
|
63
|
+
//Choice: Any combination. Sum of all dice Dice.
|
64
|
+
case YachtCategory.Choice: return dice.Sum();
|
65
|
+
//Yacht: All five dice showing the same face - scores 50.
|
66
|
+
case YachtCategory.Yacht:
|
67
|
+
return dice.Distinct().Count() == 1 ? 50 : 0;
|
68
|
+
default: return 0;
|
69
|
+
}
|
70
|
+
}
|
71
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Score a single throw of dice in *Yacht*
|
2
|
+
|
3
|
+
The dice game [Yacht](https://en.wikipedia.org/wiki/Yacht_(dice_game)) is from
|
4
|
+
the same family as Poker Dice, Generala and particularly Yahtzee, of which it
|
5
|
+
is a precursor. In the game, five dice are rolled and the result can be entered
|
6
|
+
in any of twelve categories. The score of a throw of the dice depends on
|
7
|
+
category chosen.
|
8
|
+
|
9
|
+
## Scores in Yacht
|
10
|
+
|
11
|
+
Category Score Example
|
12
|
+
Ones 1 × number of ones 1 1 1 4 5 scores 3
|
13
|
+
Twos 2 × number of twos 2 2 3 4 5 scores 4
|
14
|
+
Threes 3 × number of threes 3 3 3 3 3 scores 15
|
15
|
+
Fours 4 × number of fours 1 2 3 3 5 scores 0
|
16
|
+
Fives 5 × number of fives 5 1 5 2 5 scores 15
|
17
|
+
Sixes 6 × number of sixes 2 3 4 5 6 scores 6
|
18
|
+
Full House Total of the dice 3 3 3 5 5 scores 19
|
19
|
+
Four of a Kind Total of the four dice 4 4 4 4 6 scores 16
|
20
|
+
Little Straight 30 points 1 2 3 4 5 scores 30
|
21
|
+
Big Straight 30 points 2 3 4 5 6 scores 30
|
22
|
+
Choice Sum of the dice 2 3 3 4 6 scores 18
|
23
|
+
Yacht 50 points 4 4 4 4 4 scores 50
|
24
|
+
|
25
|
+
If the dice do not satisfy the requirements of a category, the score is zero.
|
26
|
+
If, for example, *Four Of A Kind* is entered in the *Yacht* category, zero
|
27
|
+
points are scored. A *Yacht* scores zero if entered in the *Full House* category.
|
28
|
+
|
29
|
+
## Task
|
30
|
+
Given a list of values for five dice and a category, your solution should return
|
31
|
+
the score of the dice for that category. If the dice do not satisfy the requirements
|
32
|
+
of the category your solution should return 0. You can assume that five values
|
33
|
+
will always be presented, and the value of each will be between one and six
|
34
|
+
inclusively. You should not assume that the dice are ordered.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
using System;
|
2
|
+
|
3
|
+
public enum YachtCategory
|
4
|
+
{
|
5
|
+
Ones = 1,
|
6
|
+
Twos = 2,
|
7
|
+
Threes = 3,
|
8
|
+
Fours = 4,
|
9
|
+
Fives = 5,
|
10
|
+
Sixes = 6,
|
11
|
+
FullHouse = 7,
|
12
|
+
FourOfAKind = 8,
|
13
|
+
LittleStraight = 9,
|
14
|
+
BigStraight = 10,
|
15
|
+
Choice = 11,
|
16
|
+
Yacht = 12,
|
17
|
+
}
|
18
|
+
|
19
|
+
public static class YachtGame
|
20
|
+
{
|
21
|
+
public static int Score(int[] dice, YachtCategory category)
|
22
|
+
{
|
23
|
+
throw new NotImplementedException("You need to implement this function.");
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<Project Sdk="Microsoft.NET.Sdk">
|
2
|
+
|
3
|
+
<PropertyGroup>
|
4
|
+
<OutputType>Exe</OutputType>
|
5
|
+
<TargetFramework>netcoreapp2.0</TargetFramework>
|
6
|
+
</PropertyGroup>
|
7
|
+
|
8
|
+
<ItemGroup>
|
9
|
+
<Compile Remove="Example.cs" />
|
10
|
+
</ItemGroup>
|
11
|
+
|
12
|
+
<ItemGroup>
|
13
|
+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.6.2" />
|
14
|
+
<PackageReference Include="xunit" Version="2.3.1" />
|
15
|
+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
|
16
|
+
</ItemGroup>
|
17
|
+
|
18
|
+
</Project>
|
@@ -0,0 +1,162 @@
|
|
1
|
+
// This file was auto-generated based on version 1.0.0 of the canonical data.
|
2
|
+
|
3
|
+
using Xunit;
|
4
|
+
|
5
|
+
public class YachtTest
|
6
|
+
{
|
7
|
+
[Fact]
|
8
|
+
public void Yacht()
|
9
|
+
{
|
10
|
+
Assert.Equal(50, YachtGame.Score(new[] { 5, 5, 5, 5, 5 }, YachtCategory.Yacht));
|
11
|
+
}
|
12
|
+
|
13
|
+
[Fact(Skip = "Remove to run test")]
|
14
|
+
public void Not_yacht()
|
15
|
+
{
|
16
|
+
Assert.Equal(0, YachtGame.Score(new[] { 1, 3, 3, 2, 5 }, YachtCategory.Yacht));
|
17
|
+
}
|
18
|
+
|
19
|
+
[Fact(Skip = "Remove to run test")]
|
20
|
+
public void Ones()
|
21
|
+
{
|
22
|
+
Assert.Equal(3, YachtGame.Score(new[] { 1, 1, 1, 3, 5 }, YachtCategory.Ones));
|
23
|
+
}
|
24
|
+
|
25
|
+
[Fact(Skip = "Remove to run test")]
|
26
|
+
public void Ones_out_of_order()
|
27
|
+
{
|
28
|
+
Assert.Equal(3, YachtGame.Score(new[] { 3, 1, 1, 5, 1 }, YachtCategory.Ones));
|
29
|
+
}
|
30
|
+
|
31
|
+
[Fact(Skip = "Remove to run test")]
|
32
|
+
public void No_ones()
|
33
|
+
{
|
34
|
+
Assert.Equal(0, YachtGame.Score(new[] { 4, 3, 6, 5, 5 }, YachtCategory.Ones));
|
35
|
+
}
|
36
|
+
|
37
|
+
[Fact(Skip = "Remove to run test")]
|
38
|
+
public void Twos()
|
39
|
+
{
|
40
|
+
Assert.Equal(2, YachtGame.Score(new[] { 2, 3, 4, 5, 6 }, YachtCategory.Twos));
|
41
|
+
}
|
42
|
+
|
43
|
+
[Fact(Skip = "Remove to run test")]
|
44
|
+
public void Fours()
|
45
|
+
{
|
46
|
+
Assert.Equal(8, YachtGame.Score(new[] { 1, 4, 1, 4, 1 }, YachtCategory.Fours));
|
47
|
+
}
|
48
|
+
|
49
|
+
[Fact(Skip = "Remove to run test")]
|
50
|
+
public void Yacht_counted_as_threes()
|
51
|
+
{
|
52
|
+
Assert.Equal(15, YachtGame.Score(new[] { 3, 3, 3, 3, 3 }, YachtCategory.Threes));
|
53
|
+
}
|
54
|
+
|
55
|
+
[Fact(Skip = "Remove to run test")]
|
56
|
+
public void Yacht_of_3s_counted_as_fives()
|
57
|
+
{
|
58
|
+
Assert.Equal(0, YachtGame.Score(new[] { 3, 3, 3, 3, 3 }, YachtCategory.Fives));
|
59
|
+
}
|
60
|
+
|
61
|
+
[Fact(Skip = "Remove to run test")]
|
62
|
+
public void Sixes()
|
63
|
+
{
|
64
|
+
Assert.Equal(6, YachtGame.Score(new[] { 2, 3, 4, 5, 6 }, YachtCategory.Sixes));
|
65
|
+
}
|
66
|
+
|
67
|
+
[Fact(Skip = "Remove to run test")]
|
68
|
+
public void Full_house_two_small_three_big()
|
69
|
+
{
|
70
|
+
Assert.Equal(16, YachtGame.Score(new[] { 2, 2, 4, 4, 4 }, YachtCategory.FullHouse));
|
71
|
+
}
|
72
|
+
|
73
|
+
[Fact(Skip = "Remove to run test")]
|
74
|
+
public void Full_house_three_small_two_big()
|
75
|
+
{
|
76
|
+
Assert.Equal(19, YachtGame.Score(new[] { 5, 3, 3, 5, 3 }, YachtCategory.FullHouse));
|
77
|
+
}
|
78
|
+
|
79
|
+
[Fact(Skip = "Remove to run test")]
|
80
|
+
public void Two_pair_is_not_a_full_house()
|
81
|
+
{
|
82
|
+
Assert.Equal(0, YachtGame.Score(new[] { 2, 2, 4, 4, 5 }, YachtCategory.FullHouse));
|
83
|
+
}
|
84
|
+
|
85
|
+
[Fact(Skip = "Remove to run test")]
|
86
|
+
public void Yacht_is_not_a_full_house()
|
87
|
+
{
|
88
|
+
Assert.Equal(0, YachtGame.Score(new[] { 2, 2, 2, 2, 2 }, YachtCategory.FullHouse));
|
89
|
+
}
|
90
|
+
|
91
|
+
[Fact(Skip = "Remove to run test")]
|
92
|
+
public void Four_of_a_kind()
|
93
|
+
{
|
94
|
+
Assert.Equal(24, YachtGame.Score(new[] { 6, 6, 4, 6, 6 }, YachtCategory.FourOfAKind));
|
95
|
+
}
|
96
|
+
|
97
|
+
[Fact(Skip = "Remove to run test")]
|
98
|
+
public void Yacht_can_be_scored_as_four_of_a_kind()
|
99
|
+
{
|
100
|
+
Assert.Equal(12, YachtGame.Score(new[] { 3, 3, 3, 3, 3 }, YachtCategory.FourOfAKind));
|
101
|
+
}
|
102
|
+
|
103
|
+
[Fact(Skip = "Remove to run test")]
|
104
|
+
public void Full_house_is_not_four_of_a_kind()
|
105
|
+
{
|
106
|
+
Assert.Equal(0, YachtGame.Score(new[] { 3, 3, 3, 5, 5 }, YachtCategory.FourOfAKind));
|
107
|
+
}
|
108
|
+
|
109
|
+
[Fact(Skip = "Remove to run test")]
|
110
|
+
public void Little_straight()
|
111
|
+
{
|
112
|
+
Assert.Equal(30, YachtGame.Score(new[] { 3, 5, 4, 1, 2 }, YachtCategory.LittleStraight));
|
113
|
+
}
|
114
|
+
|
115
|
+
[Fact(Skip = "Remove to run test")]
|
116
|
+
public void Little_straight_as_big_straight()
|
117
|
+
{
|
118
|
+
Assert.Equal(0, YachtGame.Score(new[] { 1, 2, 3, 4, 5 }, YachtCategory.BigStraight));
|
119
|
+
}
|
120
|
+
|
121
|
+
[Fact(Skip = "Remove to run test")]
|
122
|
+
public void Four_in_order_but_not_a_little_straight()
|
123
|
+
{
|
124
|
+
Assert.Equal(0, YachtGame.Score(new[] { 1, 1, 2, 3, 4 }, YachtCategory.LittleStraight));
|
125
|
+
}
|
126
|
+
|
127
|
+
[Fact(Skip = "Remove to run test")]
|
128
|
+
public void No_pairs_but_not_a_little_straight()
|
129
|
+
{
|
130
|
+
Assert.Equal(0, YachtGame.Score(new[] { 1, 2, 3, 4, 6 }, YachtCategory.LittleStraight));
|
131
|
+
}
|
132
|
+
|
133
|
+
[Fact(Skip = "Remove to run test")]
|
134
|
+
public void Minimum_is_1_maximum_is_5_but_not_a_little_straight()
|
135
|
+
{
|
136
|
+
Assert.Equal(0, YachtGame.Score(new[] { 1, 1, 3, 4, 5 }, YachtCategory.LittleStraight));
|
137
|
+
}
|
138
|
+
|
139
|
+
[Fact(Skip = "Remove to run test")]
|
140
|
+
public void Big_straight()
|
141
|
+
{
|
142
|
+
Assert.Equal(30, YachtGame.Score(new[] { 4, 6, 2, 5, 3 }, YachtCategory.BigStraight));
|
143
|
+
}
|
144
|
+
|
145
|
+
[Fact(Skip = "Remove to run test")]
|
146
|
+
public void Big_straight_as_little_straight()
|
147
|
+
{
|
148
|
+
Assert.Equal(0, YachtGame.Score(new[] { 6, 5, 4, 3, 2 }, YachtCategory.LittleStraight));
|
149
|
+
}
|
150
|
+
|
151
|
+
[Fact(Skip = "Remove to run test")]
|
152
|
+
public void Choice()
|
153
|
+
{
|
154
|
+
Assert.Equal(23, YachtGame.Score(new[] { 3, 3, 5, 6, 6 }, YachtCategory.Choice));
|
155
|
+
}
|
156
|
+
|
157
|
+
[Fact(Skip = "Remove to run test")]
|
158
|
+
public void Yacht_as_choice()
|
159
|
+
{
|
160
|
+
Assert.Equal(10, YachtGame.Score(new[] { 2, 2, 2, 2, 2 }, YachtCategory.Choice));
|
161
|
+
}
|
162
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
using System;
|
2
|
+
using Generators.Input;
|
3
|
+
using Generators.Output;
|
4
|
+
using Humanizer;
|
5
|
+
|
6
|
+
namespace Generators.Exercises
|
7
|
+
{
|
8
|
+
public class Yacht: GeneratorExercise
|
9
|
+
{
|
10
|
+
protected override void UpdateCanonicalData(CanonicalData canonicalData)
|
11
|
+
{
|
12
|
+
canonicalData.Exercise = "yacht-game";
|
13
|
+
foreach (var canonicalDataCase in canonicalData.Cases)
|
14
|
+
{
|
15
|
+
var input = canonicalDataCase.Properties["input"] as System.Collections.Generic.Dictionary<string,object>;
|
16
|
+
input["category"] = new UnescapedValue($"YachtCategory.{input["category"].ToString().Dehumanize()}");
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
@@ -1,13 +1,9 @@
|
|
1
|
-
class
|
2
|
-
int
|
3
|
-
|
4
|
-
Year(int this.value);
|
5
|
-
|
6
|
-
bool isLeap() {
|
7
|
-
if (value % 4 != 0) {
|
1
|
+
class Leap {
|
2
|
+
bool leapYear(int year) {
|
3
|
+
if (year % 4 != 0) {
|
8
4
|
return false;
|
9
5
|
}
|
10
6
|
|
11
|
-
return
|
7
|
+
return year % 100 != 0 || year % 400 == 0;
|
12
8
|
}
|
13
9
|
}
|
@@ -1,30 +1,28 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import 'package:test/test.dart';
|
2
|
+
import 'package:leap/leap.dart';
|
3
3
|
|
4
4
|
void main() {
|
5
|
-
|
6
|
-
test("is not very common", () {
|
7
|
-
final year = new Year(2015);
|
5
|
+
final Leap leap = new Leap();
|
8
6
|
|
9
|
-
|
10
|
-
|
7
|
+
group('Leap', () {
|
8
|
+
test("year not divisible by 4: common year", () {
|
9
|
+
final bool result = leap.leapYear(2015);
|
10
|
+
expect(result, equals(false));
|
11
|
+
}, skip: false);
|
11
12
|
|
12
13
|
test("is introduced every 4 years to adjust about a day", () {
|
13
|
-
final
|
14
|
-
|
15
|
-
expect(year.isLeap(), equals(true));
|
14
|
+
final bool result = leap.leapYear(1996);
|
15
|
+
expect(result, equals(true));
|
16
16
|
}, skip: true);
|
17
17
|
|
18
18
|
test("is skipped every 100 years to remove an extra day", () {
|
19
|
-
final
|
20
|
-
|
21
|
-
expect(year.isLeap(), equals(false));
|
19
|
+
final bool result = leap.leapYear(2100);
|
20
|
+
expect(result, equals(false));
|
22
21
|
}, skip: true);
|
23
22
|
|
24
23
|
test("is reintroduced every 400 years to adjust another day", () {
|
25
|
-
final
|
26
|
-
|
27
|
-
expect(year.isLeap(), equals(true));
|
24
|
+
final bool result = leap.leapYear(2000);
|
25
|
+
expect(result, equals(true));
|
28
26
|
}, skip: true);
|
29
27
|
});
|
30
28
|
}
|
data/tracks/delphi/config.json
CHANGED
@@ -292,6 +292,17 @@
|
|
292
292
|
"unlocked_by": null,
|
293
293
|
"uuid": "5ab52a90-8a72-42f8-b430-042436041348"
|
294
294
|
},
|
295
|
+
{
|
296
|
+
"core": false,
|
297
|
+
"difficulty": 5,
|
298
|
+
"slug": "bracket-push",
|
299
|
+
"topics": [
|
300
|
+
"parsing",
|
301
|
+
"strings"
|
302
|
+
],
|
303
|
+
"unlocked_by": "bob",
|
304
|
+
"uuid": "81e0a0f7-b97d-4ff0-90b2-a43eb933f68f"
|
305
|
+
},
|
295
306
|
{
|
296
307
|
"core": true,
|
297
308
|
"difficulty": 5,
|
@@ -0,0 +1,60 @@
|
|
1
|
+
program BracketPush;
|
2
|
+
|
3
|
+
{$IFNDEF TESTINSIGHT}
|
4
|
+
{$APPTYPE CONSOLE}
|
5
|
+
{$ENDIF}{$STRONGLINKTYPES ON}
|
6
|
+
uses
|
7
|
+
System.SysUtils,
|
8
|
+
{$IFDEF TESTINSIGHT}
|
9
|
+
TestInsight.DUnitX,
|
10
|
+
{$ENDIF }
|
11
|
+
DUnitX.Loggers.Console,
|
12
|
+
DUnitX.Loggers.Xml.NUnit,
|
13
|
+
DUnitX.TestFramework,
|
14
|
+
uBracketPushTest in 'uBracketPushTest.pas',
|
15
|
+
uBracketPush in 'uBracketPush.pas';
|
16
|
+
|
17
|
+
var
|
18
|
+
runner : ITestRunner;
|
19
|
+
results : IRunResults;
|
20
|
+
logger : ITestLogger;
|
21
|
+
nunitLogger : ITestLogger;
|
22
|
+
begin
|
23
|
+
{$IFDEF TESTINSIGHT}
|
24
|
+
TestInsight.DUnitX.RunRegisteredTests;
|
25
|
+
exit;
|
26
|
+
{$ENDIF}
|
27
|
+
try
|
28
|
+
//Check command line options, will exit if invalid
|
29
|
+
TDUnitX.CheckCommandLine;
|
30
|
+
//Create the test runner
|
31
|
+
runner := TDUnitX.CreateRunner;
|
32
|
+
//Tell the runner to use RTTI to find Fixtures
|
33
|
+
runner.UseRTTI := True;
|
34
|
+
//tell the runner how we will log things
|
35
|
+
//Log to the console window
|
36
|
+
logger := TDUnitXConsoleLogger.Create(true);
|
37
|
+
runner.AddLogger(logger);
|
38
|
+
//Generate an NUnit compatible XML File
|
39
|
+
nunitLogger := TDUnitXXMLNUnitFileLogger.Create(TDUnitX.Options.XMLOutputFile);
|
40
|
+
runner.AddLogger(nunitLogger);
|
41
|
+
runner.FailsOnNoAsserts := False; //When true, Assertions must be made during tests;
|
42
|
+
|
43
|
+
//Run tests
|
44
|
+
results := runner.Execute;
|
45
|
+
if not results.AllPassed then
|
46
|
+
System.ExitCode := EXIT_ERRORS;
|
47
|
+
|
48
|
+
{$IFNDEF CI}
|
49
|
+
//We don't want this happening when running under CI.
|
50
|
+
if TDUnitX.Options.ExitBehavior = TDUnitXExitBehavior.Pause then
|
51
|
+
begin
|
52
|
+
System.Write('Done.. press <Enter> key to quit.');
|
53
|
+
System.Readln;
|
54
|
+
end;
|
55
|
+
{$ENDIF}
|
56
|
+
except
|
57
|
+
on E: Exception do
|
58
|
+
System.Writeln(E.ClassName, ': ', E.Message);
|
59
|
+
end;
|
60
|
+
end.
|