trackler 2.2.1.107 → 2.2.1.108
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/pig-latin/description.md +4 -4
- data/tracks/c/config.json +42 -0
- data/tracks/c/exercises/bracket-push/README.md +3 -0
- data/tracks/c/exercises/bracket-push/makefile +25 -0
- data/tracks/c/exercises/bracket-push/src/example.c +52 -0
- data/tracks/c/exercises/bracket-push/src/example.h +7 -0
- data/tracks/c/exercises/bracket-push/test/test_bracket_push.c +132 -0
- data/tracks/c/exercises/bracket-push/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/bracket-push/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/bracket-push/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/etl/README.md +46 -0
- data/tracks/c/exercises/etl/makefile +25 -0
- data/tracks/c/exercises/etl/src/example.c +44 -0
- data/tracks/c/exercises/etl/src/example.h +18 -0
- data/tracks/c/exercises/etl/test/test_etl.c +120 -0
- data/tracks/c/exercises/etl/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/etl/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/etl/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/luhn/README.md +64 -0
- data/tracks/c/exercises/luhn/makefile +25 -0
- data/tracks/c/exercises/luhn/src/example.c +38 -0
- data/tracks/c/exercises/luhn/src/example.h +7 -0
- data/tracks/c/exercises/luhn/test/test_luhn.c +109 -0
- data/tracks/c/exercises/luhn/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/luhn/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/luhn/test/vendor/unity_internals.h +701 -0
- data/tracks/c/exercises/prime-factors/README.md +29 -0
- data/tracks/c/exercises/prime-factors/makefile +25 -0
- data/tracks/c/exercises/prime-factors/src/example.c +28 -0
- data/tracks/c/exercises/prime-factors/src/example.h +11 -0
- data/tracks/c/exercises/prime-factors/test/test_prime_factors.c +96 -0
- data/tracks/c/exercises/prime-factors/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/prime-factors/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/prime-factors/test/vendor/unity_internals.h +701 -0
- data/tracks/clojure/exercises/hello-world/src/example.clj +2 -3
- data/tracks/clojure/exercises/hello-world/test/hello_world_test.clj +0 -6
- data/tracks/common-lisp/README.md +3 -8
- data/tracks/common-lisp/config/exercise_readme.go.tmpl +1 -1
- data/tracks/common-lisp/exercises/acronym/README.md +1 -1
- data/tracks/common-lisp/exercises/acronym/acronym-test.lisp +0 -5
- data/tracks/common-lisp/exercises/allergies/README.md +1 -1
- data/tracks/common-lisp/exercises/anagram/README.md +1 -1
- data/tracks/common-lisp/exercises/atbash-cipher/README.md +1 -1
- data/tracks/common-lisp/exercises/beer-song/README.md +1 -1
- data/tracks/common-lisp/exercises/binary/README.md +1 -1
- data/tracks/common-lisp/exercises/bob/README.md +1 -1
- data/tracks/common-lisp/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/common-lisp/exercises/crypto-square/README.md +1 -1
- data/tracks/common-lisp/exercises/difference-of-squares/README.md +1 -1
- data/tracks/common-lisp/exercises/etl/README.md +1 -1
- data/tracks/common-lisp/exercises/gigasecond/README.md +1 -1
- data/tracks/common-lisp/exercises/grade-school/README.md +1 -1
- data/tracks/common-lisp/exercises/grains/README.md +1 -1
- data/tracks/common-lisp/exercises/hamming/README.md +1 -1
- data/tracks/common-lisp/exercises/hello-world/README.md +1 -1
- data/tracks/common-lisp/exercises/isogram/README.md +1 -1
- data/tracks/common-lisp/exercises/leap/README.md +1 -1
- data/tracks/common-lisp/exercises/meetup/README.md +1 -1
- data/tracks/common-lisp/exercises/nucleotide-count/README.md +1 -1
- data/tracks/common-lisp/exercises/pascals-triangle/README.md +1 -1
- data/tracks/common-lisp/exercises/perfect-numbers/README.md +1 -1
- data/tracks/common-lisp/exercises/phone-number/README.md +1 -1
- data/tracks/common-lisp/exercises/prime-factors/README.md +1 -1
- data/tracks/common-lisp/exercises/raindrops/README.md +1 -1
- data/tracks/common-lisp/exercises/rna-transcription/README.md +1 -1
- data/tracks/common-lisp/exercises/robot-name/README.md +1 -1
- data/tracks/common-lisp/exercises/roman-numerals/README.md +1 -1
- data/tracks/common-lisp/exercises/scrabble-score/README.md +1 -1
- data/tracks/common-lisp/exercises/sieve/README.md +1 -1
- data/tracks/common-lisp/exercises/space-age/README.md +1 -1
- data/tracks/common-lisp/exercises/strain/README.md +1 -1
- data/tracks/common-lisp/exercises/sublist/README.md +1 -1
- data/tracks/common-lisp/exercises/triangle/README.md +1 -1
- data/tracks/common-lisp/exercises/trinary/README.md +1 -1
- data/tracks/common-lisp/exercises/word-count/README.md +1 -1
- data/tracks/csharp/exercises/meetup/MeetupTest.cs +177 -177
- data/tracks/csharp/exercises/robot-simulator/Example.cs +27 -27
- data/tracks/csharp/exercises/robot-simulator/RobotSimulator.cs +3 -3
- data/tracks/csharp/exercises/robot-simulator/RobotSimulatorTest.cs +152 -31
- data/tracks/csharp/generators/Exercises/Meetup.cs +8 -9
- data/tracks/csharp/generators/Exercises/RobotSimulator.cs +116 -0
- data/tracks/delphi/exercises/allergies/uAllergyTests.pas +28 -0
- data/tracks/delphi/exercises/binary-search/uBinarySearchExample.pas +6 -0
- data/tracks/delphi/exercises/binary-search/uBinarySearchTest.pas +53 -37
- data/tracks/delphi/exercises/collatz-conjecture/uCollatzconjectureTest.pas +3 -0
- data/tracks/delphi/exercises/etl/uETLtests.pas +13 -10
- data/tracks/delphi/exercises/grains/uGrainsTests.pas +5 -2
- data/tracks/delphi/exercises/hamming/uHammingTests.pas +3 -0
- data/tracks/delphi/exercises/hello-world/uTestHelloWorld.pas +3 -0
- data/tracks/delphi/exercises/leap/uLeapTests.pas +3 -0
- data/tracks/delphi/exercises/minesweeper/uMineSweeperTest.pas +3 -0
- data/tracks/delphi/exercises/nucleotide-count/uNucleotideCountTest.pas +5 -17
- data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersExample.pas +6 -0
- data/tracks/delphi/exercises/perfect-numbers/uPerfectNumbersTest.pas +77 -26
- data/tracks/delphi/exercises/pig-latin/README.md +4 -4
- data/tracks/delphi/exercises/pig-latin/uTestPigLatin.pas +12 -9
- data/tracks/delphi/exercises/poker/uPokerExample.pas +81 -26
- data/tracks/delphi/exercises/poker/uPokerTest.pas +343 -121
- data/tracks/delphi/exercises/raindrops/uRaindropsTest.pas +3 -0
- data/tracks/delphi/exercises/saddle-points/uSaddlePointsExample.pas +4 -3
- data/tracks/delphi/exercises/saddle-points/uSaddlePointsTests.pas +25 -47
- data/tracks/delphi/exercises/triangle/uTestTriangle.pas +4 -2
- data/tracks/delphi/exercises/two-fer/utwoferTest.pas +3 -0
- data/tracks/delphi/exercises/wordy/uWordyTests.pas +3 -0
- data/tracks/ecmascript/.travis.yml +2 -1
- data/tracks/ecmascript/config.json +14 -0
- data/tracks/ecmascript/exercises/accumulate/package.json +1 -2
- data/tracks/ecmascript/exercises/acronym/package.json +1 -2
- data/tracks/ecmascript/exercises/all-your-base/package.json +1 -2
- data/tracks/ecmascript/exercises/allergies/package.json +1 -2
- data/tracks/ecmascript/exercises/alphametics/package.json +1 -2
- data/tracks/ecmascript/exercises/anagram/package.json +1 -2
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +1 -2
- data/tracks/ecmascript/exercises/beer-song/package.json +1 -2
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +1 -2
- data/tracks/ecmascript/exercises/binary-search/package.json +1 -2
- data/tracks/ecmascript/exercises/binary/package.json +1 -2
- data/tracks/ecmascript/exercises/bob/README.md +2 -0
- data/tracks/ecmascript/exercises/bob/bob.spec.js +5 -5
- data/tracks/ecmascript/exercises/bob/example.js +7 -2
- data/tracks/ecmascript/exercises/bob/package.json +1 -2
- data/tracks/ecmascript/exercises/bowling/package.json +1 -2
- data/tracks/ecmascript/exercises/bracket-push/package.json +1 -2
- data/tracks/ecmascript/exercises/change/package.json +1 -2
- data/tracks/ecmascript/exercises/circular-buffer/package.json +1 -2
- data/tracks/ecmascript/exercises/clock/package.json +1 -2
- data/tracks/ecmascript/exercises/collatz-conjecture/package.json +1 -2
- data/tracks/ecmascript/exercises/complex-numbers/package.json +1 -2
- data/tracks/ecmascript/exercises/connect/package.json +1 -2
- data/tracks/ecmascript/exercises/crypto-square/package.json +1 -2
- data/tracks/ecmascript/exercises/custom-set/package.json +1 -2
- data/tracks/ecmascript/exercises/diamond/package.json +1 -2
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +1 -2
- data/tracks/ecmascript/exercises/diffie-hellman/package.json +1 -2
- data/tracks/ecmascript/exercises/etl/package.json +1 -2
- data/tracks/ecmascript/exercises/flatten-array/package.json +1 -2
- data/tracks/ecmascript/exercises/food-chain/package.json +1 -2
- data/tracks/ecmascript/exercises/gigasecond/package.json +1 -2
- data/tracks/ecmascript/exercises/grade-school/package.json +1 -2
- data/tracks/ecmascript/exercises/grains/package.json +1 -2
- data/tracks/ecmascript/exercises/hamming/package.json +1 -2
- data/tracks/ecmascript/exercises/hello-world/package.json +1 -2
- data/tracks/ecmascript/exercises/hexadecimal/package.json +1 -2
- data/tracks/ecmascript/exercises/house/package.json +1 -2
- data/tracks/ecmascript/exercises/isbn-verifier/package.json +1 -2
- data/tracks/ecmascript/exercises/isogram/package.json +1 -2
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +1 -2
- data/tracks/ecmascript/exercises/largest-series-product/package.json +1 -2
- data/tracks/ecmascript/exercises/leap/package.json +1 -2
- data/tracks/ecmascript/exercises/linked-list/package.json +1 -2
- data/tracks/ecmascript/exercises/list-ops/package.json +1 -2
- data/tracks/ecmascript/exercises/luhn/package.json +1 -2
- data/tracks/ecmascript/exercises/matrix/package.json +1 -2
- data/tracks/ecmascript/exercises/meetup/package.json +1 -2
- data/tracks/ecmascript/exercises/minesweeper/package.json +1 -2
- data/tracks/ecmascript/exercises/nth-prime/package.json +1 -2
- data/tracks/ecmascript/exercises/nucleotide-count/README.md +60 -0
- data/tracks/ecmascript/exercises/nucleotide-count/example.js +13 -0
- data/tracks/ecmascript/exercises/nucleotide-count/nucleotide-count.spec.js +23 -0
- data/tracks/ecmascript/exercises/nucleotide-count/package.json +70 -0
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +1 -2
- data/tracks/ecmascript/exercises/octal/package.json +1 -2
- data/tracks/ecmascript/exercises/palindrome-products/package.json +1 -2
- data/tracks/ecmascript/exercises/pangram/package.json +1 -2
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +1 -2
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +1 -2
- data/tracks/ecmascript/exercises/phone-number/package.json +1 -2
- data/tracks/ecmascript/exercises/pig-latin/package.json +1 -2
- data/tracks/ecmascript/exercises/prime-factors/package.json +1 -2
- data/tracks/ecmascript/exercises/protein-translation/package.json +1 -2
- data/tracks/ecmascript/exercises/proverb/package.json +1 -2
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +1 -2
- data/tracks/ecmascript/exercises/queen-attack/package.json +1 -2
- data/tracks/ecmascript/exercises/raindrops/package.json +1 -2
- data/tracks/ecmascript/exercises/react/package.json +1 -2
- data/tracks/ecmascript/exercises/rectangles/package.json +1 -2
- data/tracks/ecmascript/exercises/rna-transcription/package.json +1 -2
- data/tracks/ecmascript/exercises/robot-name/package.json +1 -2
- data/tracks/ecmascript/exercises/robot-simulator/package.json +1 -2
- data/tracks/ecmascript/exercises/roman-numerals/package.json +1 -2
- data/tracks/ecmascript/exercises/rotational-cipher/package.json +1 -2
- data/tracks/ecmascript/exercises/run-length-encoding/package.json +1 -2
- data/tracks/ecmascript/exercises/saddle-points/package.json +1 -2
- data/tracks/ecmascript/exercises/say/package.json +1 -2
- data/tracks/ecmascript/exercises/scrabble-score/package.json +1 -2
- data/tracks/ecmascript/exercises/secret-handshake/package.json +1 -2
- data/tracks/ecmascript/exercises/series/package.json +1 -2
- data/tracks/ecmascript/exercises/sieve/package.json +1 -2
- data/tracks/ecmascript/exercises/simple-cipher/package.json +1 -2
- data/tracks/ecmascript/exercises/simple-linked-list/package.json +1 -2
- data/tracks/ecmascript/exercises/space-age/package.json +1 -2
- data/tracks/ecmascript/exercises/spiral-matrix/package.json +1 -2
- data/tracks/ecmascript/exercises/strain/package.json +1 -2
- data/tracks/ecmascript/exercises/sublist/package.json +1 -2
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +1 -2
- data/tracks/ecmascript/exercises/transpose/package.json +1 -2
- data/tracks/ecmascript/exercises/triangle/package.json +1 -2
- data/tracks/ecmascript/exercises/trinary/package.json +1 -2
- data/tracks/ecmascript/exercises/twelve-days/package.json +1 -2
- data/tracks/ecmascript/exercises/two-bucket/package.json +1 -2
- data/tracks/ecmascript/exercises/two-fer/package.json +1 -2
- data/tracks/ecmascript/exercises/word-count/package.json +1 -2
- data/tracks/ecmascript/exercises/word-search/package.json +1 -2
- data/tracks/ecmascript/exercises/wordy/package.json +1 -2
- data/tracks/ecmascript/package.json +1 -2
- data/tracks/elm/config.json +13 -1
- data/tracks/elm/exercises/binary-search/BinarySearch.elm +9 -0
- data/tracks/elm/exercises/binary-search/BinarySearch.example.elm +36 -0
- data/tracks/elm/exercises/binary-search/README.md +71 -0
- data/tracks/elm/exercises/binary-search/elm-package.json +15 -0
- data/tracks/elm/exercises/binary-search/tests/Tests.elm +66 -0
- data/tracks/elm/exercises/binary-search/tests/elm-package.json +17 -0
- data/tracks/elm/exercises/hamming/Hamming.example.elm +3 -3
- data/tracks/elm/exercises/hamming/tests/Tests.elm +14 -14
- data/tracks/go/exercises/word-search/.meta/gen.go +9 -7
- data/tracks/go/exercises/word-search/cases_test.go +2 -2
- data/tracks/groovy/config.json +12 -0
- data/tracks/groovy/exercises/bank-account/BankAccount.groovy +30 -0
- data/tracks/groovy/exercises/bank-account/BankAccountSpec.groovy +200 -0
- data/tracks/groovy/exercises/bank-account/Example.groovy +47 -0
- data/tracks/groovy/exercises/bank-account/README.md +75 -0
- data/tracks/groovy/exercises/phone-number/Example.groovy +10 -14
- data/tracks/groovy/exercises/phone-number/PhoneNumber.groovy +2 -14
- data/tracks/groovy/exercises/phone-number/PhoneNumberSpec.groovy +39 -26
- data/tracks/groovy/exercises/phone-number/README.md +1 -1
- data/tracks/java/config.json +13 -0
- data/tracks/java/exercises/forth/README.md +10 -0
- data/tracks/java/exercises/rna-transcription/.meta/version +1 -1
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/sieve/.meta/version +1 -1
- data/tracks/java/exercises/spiral-matrix/.meta/version +1 -1
- data/tracks/java/exercises/triangle/.meta/version +1 -1
- data/tracks/java/exercises/two-bucket/README.md +1 -1
- data/tracks/java/exercises/zipper/.meta/src/reference/java/Zipper.java +199 -0
- data/tracks/java/exercises/zipper/.meta/version +1 -0
- data/tracks/java/exercises/zipper/README.md +42 -0
- data/tracks/java/exercises/zipper/build.gradle +18 -0
- data/tracks/java/exercises/zipper/src/main/java/.keep +0 -0
- data/tracks/java/exercises/zipper/src/test/java/ZipperTest.java +204 -0
- data/tracks/javascript/package.json +10 -0
- data/tracks/ocaml/.travis-ci.sh +1 -1
- data/tracks/ocaml/.travis.yml +1 -1
- data/tracks/ocaml/README.md +1 -1
- data/tracks/ocaml/config/exercise_readme.go.tmpl +2 -0
- data/tracks/python/config.json +13 -0
- data/tracks/python/exercises/all-your-base/all_your_base.py +1 -1
- data/tracks/python/exercises/all-your-base/all_your_base_test.py +8 -8
- data/tracks/python/exercises/alphametics/alphametics_test.py +49 -9
- data/tracks/python/exercises/binary-search-tree/binary_search_tree.py +11 -5
- data/tracks/python/exercises/binary-search-tree/binary_search_tree_test.py +89 -48
- data/tracks/python/exercises/binary-search-tree/example.py +42 -52
- data/tracks/python/exercises/binary-search/binary_search_test.py +1 -1
- data/tracks/python/exercises/book-store/book_store_test.py +18 -39
- data/tracks/python/exercises/book-store/example.py +1 -1
- data/tracks/python/exercises/bowling/bowling.py +0 -2
- data/tracks/python/exercises/bowling/bowling_test.py +49 -13
- data/tracks/python/exercises/bowling/example.py +85 -135
- data/tracks/python/exercises/bracket-push/bracket_push.py +1 -1
- data/tracks/python/exercises/bracket-push/bracket_push_test.py +16 -16
- data/tracks/python/exercises/bracket-push/example.py +2 -2
- data/tracks/python/exercises/change/change_test.py +17 -4
- data/tracks/python/exercises/change/example.py +2 -2
- data/tracks/python/exercises/circular-buffer/circular_buffer.py +12 -0
- data/tracks/python/exercises/circular-buffer/circular_buffer_test.py +4 -11
- data/tracks/python/exercises/clock/clock.py +10 -1
- data/tracks/python/exercises/clock/clock_test.py +9 -9
- data/tracks/python/exercises/clock/example.py +4 -1
- data/tracks/python/exercises/collatz-conjecture/collatz_conjecture_test.py +15 -5
- data/tracks/python/exercises/collatz-conjecture/example.py +1 -1
- data/tracks/python/exercises/complex-numbers/complex_numbers_test.py +37 -26
- data/tracks/python/exercises/custom-set/custom_set_test.py +1 -1
- data/tracks/python/exercises/diamond/diamond_test.py +1 -1
- data/tracks/python/exercises/dominoes/dominoes_test.py +1 -1
- data/tracks/python/exercises/forth/forth_test.py +1 -1
- data/tracks/python/exercises/house/example.py +11 -3
- data/tracks/python/exercises/house/house.py +1 -5
- data/tracks/python/exercises/house/house_test.py +269 -116
- data/tracks/python/exercises/list-ops/list_ops_test.py +1 -1
- data/tracks/python/exercises/luhn/luhn.py +3 -0
- data/tracks/python/exercises/luhn/luhn_test.py +1 -1
- data/tracks/python/exercises/markdown/markdown_test.py +2 -3
- data/tracks/python/exercises/minesweeper/minesweeper_test.py +1 -1
- data/tracks/python/exercises/nth-prime/nth_prime_test.py +1 -1
- data/tracks/python/exercises/ocr-numbers/ocr_numbers_test.py +1 -1
- data/tracks/python/exercises/palindrome-products/palindrome_products_test.py +14 -6
- data/tracks/python/exercises/perfect-numbers/perfect_numbers_test.py +1 -24
- data/tracks/python/exercises/phone-number/phone_number_test.py +11 -3
- data/tracks/python/exercises/poker/example.py +4 -3
- data/tracks/python/exercises/poker/poker.py +1 -1
- data/tracks/python/exercises/poker/poker_test.py +196 -119
- data/tracks/python/exercises/pov/example.py +3 -3
- data/tracks/python/exercises/pov/pov.py +2 -2
- data/tracks/python/exercises/pov/pov_test.py +19 -18
- data/tracks/python/exercises/protein-translation/protein_translation_test.py +14 -24
- data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher_test.py +1 -1
- data/tracks/python/exercises/rational-numbers/README.md +59 -0
- data/tracks/python/exercises/rational-numbers/example.py +58 -0
- data/tracks/python/exercises/rational-numbers/rational_numbers.py +34 -0
- data/tracks/python/exercises/rational-numbers/rational_numbers_test.py +132 -0
- data/tracks/python/exercises/rectangles/rectangles_test.py +1 -1
- data/tracks/python/exercises/roman-numerals/roman_numerals_test.py +2 -1
- data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +2 -2
- data/tracks/python/exercises/saddle-points/saddle_points_test.py +18 -18
- data/tracks/python/exercises/scale-generator/example.py +4 -5
- data/tracks/python/exercises/scale-generator/scale_generator.py +2 -2
- data/tracks/python/exercises/scale-generator/scale_generator_test.py +38 -73
- data/tracks/python/exercises/secret-handshake/secret_handshake_test.py +1 -1
- data/tracks/python/exercises/tournament/tournament_test.py +1 -1
- data/tracks/python/exercises/twelve-days/example.py +3 -8
- data/tracks/python/exercises/twelve-days/twelve_days.py +1 -9
- data/tracks/python/exercises/twelve-days/twelve_days_test.py +51 -50
- data/tracks/python/exercises/two-bucket/example.py +3 -4
- data/tracks/python/exercises/two-bucket/two_bucket.py +1 -1
- data/tracks/python/exercises/two-bucket/two_bucket_test.py +8 -13
- data/tracks/python/exercises/two-fer/two_fer_test.py +8 -9
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +1 -1
- data/tracks/python/exercises/word-count/word_count_test.py +8 -14
- data/tracks/python/exercises/word-search/word_search.py +3 -15
- data/tracks/python/exercises/word-search/word_search_test.py +1 -1
- data/tracks/python/exercises/wordy/wordy_test.py +1 -1
- data/tracks/python/exercises/zebra-puzzle/example.py +11 -2
- data/tracks/python/exercises/zebra-puzzle/zebra_puzzle.py +5 -1
- data/tracks/python/exercises/zebra-puzzle/zebra_puzzle_test.py +8 -5
- data/tracks/python/exercises/zipper/zipper_test.py +24 -30
- data/tracks/scala/exercises/dominoes/src/test/scala/DominoesTest.scala +2 -2
- data/tracks/scala/exercises/flatten-array/src/test/scala/FlattenArrayTest.scala +1 -1
- data/tracks/scala/exercises/food-chain/example.scala +3 -3
- data/tracks/scala/exercises/food-chain/src/test/scala/FoodChainTest.scala +12 -12
- data/tracks/scala/exercises/forth/src/test/scala/ForthTest.scala +35 -10
- data/tracks/scala/exercises/gigasecond/src/test/scala/GigasecondTest.scala +2 -2
- data/tracks/scala/exercises/hamming/src/test/scala/HammingTest.scala +4 -4
- data/tracks/scala/exercises/hello-world/src/test/scala/HelloWorldTest.scala +2 -3
- data/tracks/scala/exercises/house/example.scala +4 -5
- data/tracks/scala/exercises/house/src/test/scala/HouseTest.scala +16 -17
- data/tracks/scala/exercises/isogram/src/test/scala/IsogramTest.scala +3 -3
- data/tracks/scala/exercises/kindergarten-garden/src/test/scala/GardenTest.scala +1 -29
- data/tracks/scala/exercises/largest-series-product/src/test/scala/SeriesTest.scala +20 -17
- data/tracks/scala/exercises/leap/src/test/scala/LeapTest.scala +3 -3
- data/tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala +3 -3
- data/tracks/scala/exercises/matrix/example.scala +5 -1
- data/tracks/scala/exercises/matrix/src/test/scala/MatrixTest.scala +48 -12
- data/tracks/scala/exercises/meetup/src/test/scala/MeetupTest.scala +2 -1
- data/tracks/scala/exercises/minesweeper/src/test/scala/MinesweeperTest.scala +9 -9
- data/tracks/scala/testgen/src/main/scala/DominoesTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/FlattenArrayTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/FoodChainTestGenerator.scala +10 -12
- data/tracks/scala/testgen/src/main/scala/ForthTestGenerator.scala +6 -6
- data/tracks/scala/testgen/src/main/scala/GigasecondTestGenerator.scala +6 -4
- data/tracks/scala/testgen/src/main/scala/HammingTestGenerator.scala +3 -3
- data/tracks/scala/testgen/src/main/scala/HouseTestGenerator.scala +10 -16
- data/tracks/scala/testgen/src/main/scala/IsogramTestGenerator.scala +1 -1
- data/tracks/scala/testgen/src/main/scala/KindergartenGardenTestGenerator.scala +6 -5
- data/tracks/scala/testgen/src/main/scala/LeapTestGenerator.scala +3 -3
- data/tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala +1 -1
- data/tracks/scala/testgen/src/main/scala/MatrixTestGenerator.scala +35 -0
- data/tracks/scala/testgen/src/main/scala/MeetupTestGenerator.scala +14 -11
- data/tracks/scala/testgen/src/main/scala/MinesweeperTestGenerator.scala +1 -1
- data/tracks/scala/testgen/src/main/scala/SeriesTestGenerator.scala +3 -3
- data/tracks/typescript/config/exercise_readme.go.tmpl +25 -4
- data/tracks/typescript/exercises/acronym/README.md +7 -2
- data/tracks/typescript/exercises/atbash-cipher/README.md +2 -1
- data/tracks/typescript/exercises/beer-song/README.md +2 -2
- data/tracks/typescript/exercises/binary-search-tree/README.md +2 -0
- data/tracks/typescript/exercises/circular-buffer/README.md +16 -7
- data/tracks/typescript/exercises/clock/README.md +6 -0
- data/tracks/typescript/exercises/diamond/README.md +8 -7
- data/tracks/typescript/exercises/etl/README.md +3 -1
- data/tracks/typescript/exercises/food-chain/README.md +1 -1
- data/tracks/typescript/exercises/grade-school/README.md +0 -1
- data/tracks/typescript/exercises/hello-world/.meta/hints.md +378 -0
- data/tracks/typescript/exercises/hello-world/README.md +37 -11
- data/tracks/typescript/exercises/largest-series-product/README.md +1 -6
- data/tracks/typescript/exercises/leap/README.md +1 -1
- data/tracks/typescript/exercises/linked-list/README.md +20 -15
- data/tracks/typescript/exercises/nth-prime/README.md +7 -2
- data/tracks/typescript/exercises/ocr-numbers/README.md +7 -6
- data/tracks/typescript/exercises/pangram/README.md +1 -1
- data/tracks/typescript/exercises/pascals-triangle/README.md +1 -1
- data/tracks/typescript/exercises/phone-number/README.md +4 -3
- data/tracks/typescript/exercises/prime-factors/README.md +1 -12
- data/tracks/typescript/exercises/pythagorean-triplet/README.md +3 -7
- data/tracks/typescript/exercises/rna-transcription/README.md +2 -2
- data/tracks/typescript/exercises/robot-simulator/README.md +3 -1
- data/tracks/typescript/exercises/scrabble-score/README.md +3 -1
- data/tracks/typescript/exercises/series/README.md +0 -4
- data/tracks/typescript/exercises/space-age/README.md +1 -1
- data/tracks/typescript/exercises/strain/README.md +6 -0
- data/tracks/typescript/exercises/sum-of-multiples/README.md +4 -7
- data/tracks/typescript/exercises/two-bucket/README.md +15 -19
- data/tracks/typescript/exercises/word-count/README.md +1 -2
- data/tracks/typescript/exercises/wordy/README.md +0 -5
- metadata +61 -5
- data/tracks/common-lisp/exercises/bob/.meta/description.md +0 -10
- data/tracks/javascript/.eslintrc.json +0 -10
- data/tracks/typescript/docs/EXERCISE_README_INSERT.md +0 -24
@@ -1,16 +1,11 @@
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
2
2
|
|
3
|
-
/** @version 1.
|
3
|
+
/** @version 1.5.0 */
|
4
4
|
class ForthTest extends FunSuite with Matchers {
|
5
5
|
|
6
6
|
private val forth = new Forth
|
7
7
|
|
8
|
-
test("parsing and numbers - empty input results in empty stack") {
|
9
|
-
forth.eval("").fold(_ => "", _.toString) should be ("")
|
10
|
-
}
|
11
|
-
|
12
8
|
test("parsing and numbers - numbers just get pushed onto the stack") {
|
13
|
-
pending
|
14
9
|
forth.eval("1 2 3 4 5").fold(_ => "", _.toString) should be ("1 2 3 4 5")
|
15
10
|
}
|
16
11
|
|
@@ -94,14 +89,14 @@ class ForthTest extends FunSuite with Matchers {
|
|
94
89
|
forth.eval("2 4 * 3 /").fold(_ => "", _.toString) should be ("2")
|
95
90
|
}
|
96
91
|
|
97
|
-
test("dup - copies
|
92
|
+
test("dup - copies a value on the stack") {
|
98
93
|
pending
|
99
|
-
forth.eval("1
|
94
|
+
forth.eval("1 dup").fold(_ => "", _.toString) should be ("1 1")
|
100
95
|
}
|
101
96
|
|
102
|
-
test("dup -
|
97
|
+
test("dup - copies the top value on the stack") {
|
103
98
|
pending
|
104
|
-
forth.eval("1 2
|
99
|
+
forth.eval("1 2 dup").fold(_ => "", _.toString) should be ("1 2 2")
|
105
100
|
}
|
106
101
|
|
107
102
|
test("dup - errors if there is nothing on the stack") {
|
@@ -198,4 +193,34 @@ class ForthTest extends FunSuite with Matchers {
|
|
198
193
|
pending
|
199
194
|
forth.eval("foo").isLeft should be (true)
|
200
195
|
}
|
196
|
+
|
197
|
+
test("case-insensitivity - DUP is case-insensitive") {
|
198
|
+
pending
|
199
|
+
forth.eval("1 DUP Dup dup").fold(_ => "", _.toString) should be ("1 1 1 1")
|
200
|
+
}
|
201
|
+
|
202
|
+
test("case-insensitivity - DROP is case-insensitive") {
|
203
|
+
pending
|
204
|
+
forth.eval("1 2 3 4 DROP Drop drop").fold(_ => "", _.toString) should be ("1")
|
205
|
+
}
|
206
|
+
|
207
|
+
test("case-insensitivity - SWAP is case-insensitive") {
|
208
|
+
pending
|
209
|
+
forth.eval("1 2 SWAP 3 Swap 4 swap").fold(_ => "", _.toString) should be ("2 3 4 1")
|
210
|
+
}
|
211
|
+
|
212
|
+
test("case-insensitivity - OVER is case-insensitive") {
|
213
|
+
pending
|
214
|
+
forth.eval("1 2 OVER Over over").fold(_ => "", _.toString) should be ("1 2 1 2 1")
|
215
|
+
}
|
216
|
+
|
217
|
+
test("case-insensitivity - user-defined words are case-insensitive") {
|
218
|
+
pending
|
219
|
+
forth.eval(": foo dup ; 1 FOO Foo foo").fold(_ => "", _.toString) should be ("1 1 1 1")
|
220
|
+
}
|
221
|
+
|
222
|
+
test("case-insensitivity - definitions are case-insensitive") {
|
223
|
+
pending
|
224
|
+
forth.eval(": SWAP DUP Dup dup ; 1 swap").fold(_ => "", _.toString) should be ("1 1 1 1")
|
225
|
+
}
|
201
226
|
}
|
@@ -4,7 +4,7 @@ import java.time.format.DateTimeFormatter
|
|
4
4
|
|
5
5
|
import org.scalatest.{Matchers, FunSuite}
|
6
6
|
|
7
|
-
/** @version 1.
|
7
|
+
/** @version 1.1.0 */
|
8
8
|
class GigasecondTest extends FunSuite with Matchers {
|
9
9
|
|
10
10
|
private def dateTime(str: String): LocalDateTime =
|
@@ -45,4 +45,4 @@ class GigasecondTest extends FunSuite with Matchers {
|
|
45
45
|
val expected = dateTime("2046-10-03T01:46:39")
|
46
46
|
Gigasecond.add(input) should be (expected)
|
47
47
|
}
|
48
|
-
}
|
48
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
2
2
|
|
3
|
-
/** @version 2.
|
3
|
+
/** @version 2.1.0 */
|
4
4
|
class HammingTest extends FunSuite with Matchers {
|
5
5
|
|
6
6
|
test("empty strands") {
|
@@ -44,12 +44,12 @@ class HammingTest extends FunSuite with Matchers {
|
|
44
44
|
|
45
45
|
test("non-unique character in first strand") {
|
46
46
|
pending
|
47
|
-
Hamming.distance("
|
47
|
+
Hamming.distance("AAG", "AAA") should be (Some(1))
|
48
48
|
}
|
49
49
|
|
50
50
|
test("non-unique character in second strand") {
|
51
51
|
pending
|
52
|
-
Hamming.distance("
|
52
|
+
Hamming.distance("AAA", "AAG") should be (Some(1))
|
53
53
|
}
|
54
54
|
|
55
55
|
test("same nucleotides in different positions") {
|
@@ -76,4 +76,4 @@ class HammingTest extends FunSuite with Matchers {
|
|
76
76
|
pending
|
77
77
|
Hamming.distance("ATA", "AGTG") should be (None)
|
78
78
|
}
|
79
|
-
}
|
79
|
+
}
|
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
1
|
object House {
|
3
|
-
private val parts = Vector(("lay in", "the house that Jack built"),
|
2
|
+
private val parts = Vector(("lay in", "the house that Jack built."),
|
4
3
|
("ate", "the malt"),
|
5
4
|
("killed", "the rat"),
|
6
5
|
("worried", "the cat"),
|
@@ -13,7 +12,7 @@ object House {
|
|
13
12
|
("belonged to", "the farmer sowing his corn"),
|
14
13
|
("", "the horse and the hound and the horn"))
|
15
14
|
|
16
|
-
private def
|
15
|
+
private def reciteInternal(n: Int) = {
|
17
16
|
"This is " + parts(n)._2 +
|
18
17
|
(for {
|
19
18
|
i <- List.range(0, n).reverse
|
@@ -21,7 +20,7 @@ object House {
|
|
21
20
|
"\n\n"
|
22
21
|
}
|
23
22
|
|
24
|
-
def
|
23
|
+
def recite(n: Int): String = reciteInternal(n - 1)
|
25
24
|
|
26
|
-
def
|
25
|
+
def recite(n: Int, m: Int): String = (for {i <- List.range(n - 1, m)} yield {reciteInternal(i)}).mkString
|
27
26
|
}
|
@@ -1,18 +1,17 @@
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
2
2
|
|
3
|
-
/** @version 1.0
|
3
|
+
/** @version 2.1.0 */
|
4
4
|
class HouseTest extends FunSuite with Matchers {
|
5
5
|
|
6
|
-
|
7
6
|
test("verse one - the house that jack built") {
|
8
|
-
House.
|
7
|
+
House.recite(1, 1) should be ("""This is the house that Jack built.
|
9
8
|
|
10
9
|
""")
|
11
10
|
}
|
12
11
|
|
13
12
|
test("verse two - the malt that lay") {
|
14
13
|
pending
|
15
|
-
House.
|
14
|
+
House.recite(2, 2) should be ("""This is the malt
|
16
15
|
that lay in the house that Jack built.
|
17
16
|
|
18
17
|
""")
|
@@ -20,7 +19,7 @@ that lay in the house that Jack built.
|
|
20
19
|
|
21
20
|
test("verse three - the rat that ate") {
|
22
21
|
pending
|
23
|
-
House.
|
22
|
+
House.recite(3, 3) should be ("""This is the rat
|
24
23
|
that ate the malt
|
25
24
|
that lay in the house that Jack built.
|
26
25
|
|
@@ -29,7 +28,7 @@ that lay in the house that Jack built.
|
|
29
28
|
|
30
29
|
test("verse four - the cat that killed") {
|
31
30
|
pending
|
32
|
-
House.
|
31
|
+
House.recite(4, 4) should be ("""This is the cat
|
33
32
|
that killed the rat
|
34
33
|
that ate the malt
|
35
34
|
that lay in the house that Jack built.
|
@@ -39,7 +38,7 @@ that lay in the house that Jack built.
|
|
39
38
|
|
40
39
|
test("verse five - the dog that worried") {
|
41
40
|
pending
|
42
|
-
House.
|
41
|
+
House.recite(5, 5) should be ("""This is the dog
|
43
42
|
that worried the cat
|
44
43
|
that killed the rat
|
45
44
|
that ate the malt
|
@@ -50,7 +49,7 @@ that lay in the house that Jack built.
|
|
50
49
|
|
51
50
|
test("verse six - the cow with the crumpled horn") {
|
52
51
|
pending
|
53
|
-
House.
|
52
|
+
House.recite(6, 6) should be ("""This is the cow with the crumpled horn
|
54
53
|
that tossed the dog
|
55
54
|
that worried the cat
|
56
55
|
that killed the rat
|
@@ -62,7 +61,7 @@ that lay in the house that Jack built.
|
|
62
61
|
|
63
62
|
test("verse seven - the maiden all forlorn") {
|
64
63
|
pending
|
65
|
-
House.
|
64
|
+
House.recite(7, 7) should be ("""This is the maiden all forlorn
|
66
65
|
that milked the cow with the crumpled horn
|
67
66
|
that tossed the dog
|
68
67
|
that worried the cat
|
@@ -75,7 +74,7 @@ that lay in the house that Jack built.
|
|
75
74
|
|
76
75
|
test("verse eight - the man all tattered and torn") {
|
77
76
|
pending
|
78
|
-
House.
|
77
|
+
House.recite(8, 8) should be ("""This is the man all tattered and torn
|
79
78
|
that kissed the maiden all forlorn
|
80
79
|
that milked the cow with the crumpled horn
|
81
80
|
that tossed the dog
|
@@ -89,7 +88,7 @@ that lay in the house that Jack built.
|
|
89
88
|
|
90
89
|
test("verse nine - the priest all shaven and shorn") {
|
91
90
|
pending
|
92
|
-
House.
|
91
|
+
House.recite(9, 9) should be ("""This is the priest all shaven and shorn
|
93
92
|
that married the man all tattered and torn
|
94
93
|
that kissed the maiden all forlorn
|
95
94
|
that milked the cow with the crumpled horn
|
@@ -104,7 +103,7 @@ that lay in the house that Jack built.
|
|
104
103
|
|
105
104
|
test("verse 10 - the rooster that crowed in the morn") {
|
106
105
|
pending
|
107
|
-
House.
|
106
|
+
House.recite(10, 10) should be ("""This is the rooster that crowed in the morn
|
108
107
|
that woke the priest all shaven and shorn
|
109
108
|
that married the man all tattered and torn
|
110
109
|
that kissed the maiden all forlorn
|
@@ -120,7 +119,7 @@ that lay in the house that Jack built.
|
|
120
119
|
|
121
120
|
test("verse 11 - the farmer sowing his corn") {
|
122
121
|
pending
|
123
|
-
House.
|
122
|
+
House.recite(11, 11) should be ("""This is the farmer sowing his corn
|
124
123
|
that kept the rooster that crowed in the morn
|
125
124
|
that woke the priest all shaven and shorn
|
126
125
|
that married the man all tattered and torn
|
@@ -137,7 +136,7 @@ that lay in the house that Jack built.
|
|
137
136
|
|
138
137
|
test("verse 12 - the horse and the hound and the horn") {
|
139
138
|
pending
|
140
|
-
House.
|
139
|
+
House.recite(12, 12) should be ("""This is the horse and the hound and the horn
|
141
140
|
that belonged to the farmer sowing his corn
|
142
141
|
that kept the rooster that crowed in the morn
|
143
142
|
that woke the priest all shaven and shorn
|
@@ -155,7 +154,7 @@ that lay in the house that Jack built.
|
|
155
154
|
|
156
155
|
test("multiple verses") {
|
157
156
|
pending
|
158
|
-
House.
|
157
|
+
House.recite(4, 8) should be ("""This is the cat
|
159
158
|
that killed the rat
|
160
159
|
that ate the malt
|
161
160
|
that lay in the house that Jack built.
|
@@ -195,7 +194,7 @@ that lay in the house that Jack built.
|
|
195
194
|
|
196
195
|
test("full rhyme") {
|
197
196
|
pending
|
198
|
-
House.
|
197
|
+
House.recite(1, 12) should be ("""This is the house that Jack built.
|
199
198
|
|
200
199
|
This is the malt
|
201
200
|
that lay in the house that Jack built.
|
@@ -287,4 +286,4 @@ that lay in the house that Jack built.
|
|
287
286
|
|
288
287
|
""")
|
289
288
|
}
|
290
|
-
}
|
289
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
2
2
|
|
3
|
-
/** @version 1.
|
3
|
+
/** @version 1.3.0 */
|
4
4
|
class IsogramTest extends FunSuite with Matchers {
|
5
5
|
|
6
6
|
test("empty string") {
|
@@ -32,9 +32,9 @@ class IsogramTest extends FunSuite with Matchers {
|
|
32
32
|
Isogram.isIsogram("thumbscrew-japingly") should be (true)
|
33
33
|
}
|
34
34
|
|
35
|
-
test("isogram with duplicated
|
35
|
+
test("isogram with duplicated hyphen") {
|
36
36
|
pending
|
37
|
-
Isogram.isIsogram("
|
37
|
+
Isogram.isIsogram("six-year-old") should be (true)
|
38
38
|
}
|
39
39
|
|
40
40
|
test("made-up name that is an isogram") {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
2
2
|
|
3
|
-
/** @version 1.
|
3
|
+
/** @version 1.1.0 */
|
4
4
|
class KindergartenGardenTest extends FunSuite with Matchers {
|
5
5
|
|
6
6
|
test("partial garden - garden with single student") {
|
@@ -65,32 +65,4 @@ class KindergartenGardenTest extends FunSuite with Matchers {
|
|
65
65
|
.plants("Larry") should be(
|
66
66
|
List(Plant.Grass, Plant.Violets, Plant.Clover, Plant.Violets))
|
67
67
|
}
|
68
|
-
|
69
|
-
test("non-alphabetical student list - first student's garden") {
|
70
|
-
pending
|
71
|
-
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
72
|
-
"VCRRGVRG\nRVGCCGCV").plants("Patricia") should be(
|
73
|
-
List(Plant.Violets, Plant.Clover, Plant.Radishes, Plant.Violets))
|
74
|
-
}
|
75
|
-
|
76
|
-
test("non-alphabetical student list - second student's garden") {
|
77
|
-
pending
|
78
|
-
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
79
|
-
"VCRRGVRG\nRVGCCGCV").plants("Roger") should be(
|
80
|
-
List(Plant.Radishes, Plant.Radishes, Plant.Grass, Plant.Clover))
|
81
|
-
}
|
82
|
-
|
83
|
-
test("non-alphabetical student list - third student's garden") {
|
84
|
-
pending
|
85
|
-
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
86
|
-
"VCRRGVRG\nRVGCCGCV").plants("Samantha") should be(
|
87
|
-
List(Plant.Grass, Plant.Violets, Plant.Clover, Plant.Grass))
|
88
|
-
}
|
89
|
-
|
90
|
-
test("non-alphabetical student list - fourth (last) student's garden") {
|
91
|
-
pending
|
92
|
-
Garden(List("Samantha", "Patricia", "Xander", "Roger"),
|
93
|
-
"VCRRGVRG\nRVGCCGCV").plants("Xander") should be(
|
94
|
-
List(Plant.Radishes, Plant.Grass, Plant.Clover, Plant.Violets))
|
95
|
-
}
|
96
68
|
}
|
@@ -1,79 +1,82 @@
|
|
1
1
|
import org.scalatest.{Matchers, FunSuite}
|
2
2
|
|
3
|
-
/** @version 1.
|
3
|
+
/** @version 1.1.0 */
|
4
4
|
class LargestSeriesProductTest extends FunSuite with Matchers {
|
5
5
|
|
6
6
|
test("finds the largest product if span equals length") {
|
7
|
-
Series.largestProduct(2, "29") should be
|
7
|
+
Series.largestProduct(2, "29") should be(Some(18))
|
8
8
|
}
|
9
9
|
|
10
10
|
test("can find the largest product of 2 with numbers in order") {
|
11
11
|
pending
|
12
|
-
Series.largestProduct(2, "0123456789") should be
|
12
|
+
Series.largestProduct(2, "0123456789") should be(Some(72))
|
13
13
|
}
|
14
14
|
|
15
15
|
test("can find the largest product of 2") {
|
16
16
|
pending
|
17
|
-
Series.largestProduct(2, "576802143") should be
|
17
|
+
Series.largestProduct(2, "576802143") should be(Some(48))
|
18
18
|
}
|
19
19
|
|
20
20
|
test("can find the largest product of 3 with numbers in order") {
|
21
21
|
pending
|
22
|
-
Series.largestProduct(3, "0123456789") should be
|
22
|
+
Series.largestProduct(3, "0123456789") should be(Some(504))
|
23
23
|
}
|
24
24
|
|
25
25
|
test("can find the largest product of 3") {
|
26
26
|
pending
|
27
|
-
Series.largestProduct(3, "1027839564") should be
|
27
|
+
Series.largestProduct(3, "1027839564") should be(Some(270))
|
28
28
|
}
|
29
29
|
|
30
30
|
test("can find the largest product of 5 with numbers in order") {
|
31
31
|
pending
|
32
|
-
Series.largestProduct(5, "0123456789") should be
|
32
|
+
Series.largestProduct(5, "0123456789") should be(Some(15120))
|
33
33
|
}
|
34
34
|
|
35
35
|
test("can get the largest product of a big number") {
|
36
36
|
pending
|
37
|
-
Series.largestProduct(
|
37
|
+
Series.largestProduct(
|
38
|
+
6,
|
39
|
+
"73167176531330624919225119674426574742355349194934") should be(
|
40
|
+
Some(23520))
|
38
41
|
}
|
39
42
|
|
40
43
|
test("reports zero if the only digits are zero") {
|
41
44
|
pending
|
42
|
-
Series.largestProduct(2, "0000") should be
|
45
|
+
Series.largestProduct(2, "0000") should be(Some(0))
|
43
46
|
}
|
44
47
|
|
45
48
|
test("reports zero if all spans include zero") {
|
46
49
|
pending
|
47
|
-
Series.largestProduct(3, "99099") should be
|
50
|
+
Series.largestProduct(3, "99099") should be(Some(0))
|
48
51
|
}
|
49
52
|
|
50
53
|
test("rejects span longer than string length") {
|
51
54
|
pending
|
52
|
-
Series.largestProduct(4, "123") should be
|
55
|
+
Series.largestProduct(4, "123") should be(None)
|
53
56
|
}
|
54
57
|
|
55
58
|
test("reports 1 for empty string and empty product (0 span)") {
|
56
59
|
pending
|
57
|
-
Series.largestProduct(0, "") should be
|
60
|
+
Series.largestProduct(0, "") should be(Some(1))
|
58
61
|
}
|
59
62
|
|
60
63
|
test("reports 1 for nonempty string and empty product (0 span)") {
|
61
64
|
pending
|
62
|
-
Series.largestProduct(0, "123") should be
|
65
|
+
Series.largestProduct(0, "123") should be(Some(1))
|
63
66
|
}
|
64
67
|
|
65
68
|
test("rejects empty string and nonzero span") {
|
66
69
|
pending
|
67
|
-
Series.largestProduct(1, "") should be
|
70
|
+
Series.largestProduct(1, "") should be(None)
|
68
71
|
}
|
69
72
|
|
70
73
|
test("rejects invalid character in digits") {
|
71
74
|
pending
|
72
|
-
Series.largestProduct(2, "1234a5") should be
|
75
|
+
Series.largestProduct(2, "1234a5") should be(None)
|
73
76
|
}
|
74
77
|
|
75
78
|
test("rejects negative span") {
|
76
79
|
pending
|
77
|
-
Series.largestProduct(-1, "12345") should be
|
80
|
+
Series.largestProduct(-1, "12345") should be(None)
|
78
81
|
}
|
79
|
-
}
|
82
|
+
}
|