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
@@ -2,8 +2,8 @@ import unittest
|
|
2
2
|
|
3
3
|
from clock import Clock
|
4
4
|
|
5
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.1
|
6
5
|
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.2.1
|
7
7
|
|
8
8
|
class ClockTest(unittest.TestCase):
|
9
9
|
# Test creating a new clock with an initial time.
|
@@ -90,28 +90,28 @@ class ClockTest(unittest.TestCase):
|
|
90
90
|
self.assertEqual(str(Clock(1, 1) + 3500), '11:21')
|
91
91
|
|
92
92
|
def test_subtract_minutes(self):
|
93
|
-
self.assertEqual(str(Clock(10, 3)
|
93
|
+
self.assertEqual(str(Clock(10, 3) - 3), '10:00')
|
94
94
|
|
95
95
|
def test_subtract_to_previous_hour(self):
|
96
|
-
self.assertEqual(str(Clock(10, 3)
|
96
|
+
self.assertEqual(str(Clock(10, 3) - 30), '09:33')
|
97
97
|
|
98
98
|
def test_subtract_more_than_an_hour(self):
|
99
|
-
self.assertEqual(str(Clock(10, 3)
|
99
|
+
self.assertEqual(str(Clock(10, 3) - 70), '08:53')
|
100
100
|
|
101
101
|
def test_subtract_across_midnight(self):
|
102
|
-
self.assertEqual(str(Clock(
|
102
|
+
self.assertEqual(str(Clock(0, 3) - 4), '23:59')
|
103
103
|
|
104
104
|
def test_subtract_more_than_two_hours(self):
|
105
|
-
self.assertEqual(str(Clock(0, 0)
|
105
|
+
self.assertEqual(str(Clock(0, 0) - 160), '21:20')
|
106
106
|
|
107
107
|
def test_subtract_more_than_two_hours_with_borrow(self):
|
108
|
-
self.assertEqual(str(Clock(6, 15)
|
108
|
+
self.assertEqual(str(Clock(6, 15) - 160), '03:35')
|
109
109
|
|
110
110
|
def test_subtract_more_than_one_day(self):
|
111
|
-
self.assertEqual(str(Clock(5, 32)
|
111
|
+
self.assertEqual(str(Clock(5, 32) - 1500), '04:32')
|
112
112
|
|
113
113
|
def test_subtract_more_than_two_days(self):
|
114
|
-
self.assertEqual(str(Clock(2, 20)
|
114
|
+
self.assertEqual(str(Clock(2, 20) - 3000), '00:20')
|
115
115
|
|
116
116
|
# Construct two separate clocks, set times, test if they are equal.
|
117
117
|
def test_clocks_with_same_time(self):
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
class Clock(object):
|
3
2
|
'Clock that displays 24 hour clock that rollsover properly'
|
4
3
|
|
@@ -17,6 +16,10 @@ class Clock(object):
|
|
17
16
|
self.minute += minutes
|
18
17
|
return self.cleanup()
|
19
18
|
|
19
|
+
def __sub__(self, minutes):
|
20
|
+
self.minute -= minutes
|
21
|
+
return self.cleanup()
|
22
|
+
|
20
23
|
def cleanup(self):
|
21
24
|
self.hour += self.minute // 60
|
22
25
|
self.hour %= 24
|
@@ -2,8 +2,8 @@ import unittest
|
|
2
2
|
|
3
3
|
from collatz_conjecture import collatz_steps
|
4
4
|
|
5
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.1
|
6
5
|
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
|
7
7
|
|
8
8
|
class CollatzConjectureTests(unittest.TestCase):
|
9
9
|
|
@@ -20,12 +20,22 @@ class CollatzConjectureTests(unittest.TestCase):
|
|
20
20
|
self.assertEqual(collatz_steps(1000000), 152)
|
21
21
|
|
22
22
|
def test_zero_is_invalid_input(self):
|
23
|
-
self.
|
23
|
+
with self.assertRaisesWithMessage(ValueError):
|
24
|
+
collatz_steps(0)
|
24
25
|
|
25
26
|
def test_negative_number_is_invalid_input(self):
|
26
|
-
self.
|
27
|
-
|
28
|
-
|
27
|
+
with self.assertRaisesWithMessage(ValueError):
|
28
|
+
collatz_steps(-15)
|
29
|
+
|
30
|
+
# Utility functions
|
31
|
+
def setUp(self):
|
32
|
+
try:
|
33
|
+
self.assertRaisesRegex
|
34
|
+
except AttributeError:
|
35
|
+
self.assertRaisesRegex = self.assertRaisesRegexp
|
36
|
+
|
37
|
+
def assertRaisesWithMessage(self, exception):
|
38
|
+
return self.assertRaisesRegex(exception, r".+")
|
29
39
|
|
30
40
|
|
31
41
|
if __name__ == '__main__':
|
@@ -7,11 +7,40 @@ import math
|
|
7
7
|
from complex_numbers import ComplexNumber
|
8
8
|
|
9
9
|
|
10
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
11
|
-
|
10
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
|
12
11
|
|
13
12
|
class ComplexNumbersTest(unittest.TestCase):
|
14
13
|
|
14
|
+
def test_real_part_of_a_purely_real_number(self):
|
15
|
+
input_number = ComplexNumber(1, 0)
|
16
|
+
self.assertEqual(input_number.real, 1)
|
17
|
+
|
18
|
+
def test_real_part_of_a_purely_imaginary_number(self):
|
19
|
+
input_number = ComplexNumber(0, 1)
|
20
|
+
self.assertEqual(input_number.real, 0)
|
21
|
+
|
22
|
+
def test_real_part_of_a_number_with_real_and_imaginary_part(self):
|
23
|
+
input_number = ComplexNumber(1, 2)
|
24
|
+
self.assertEqual(input_number.real, 1)
|
25
|
+
|
26
|
+
def test_imaginary_part_of_a_purely_real_number(self):
|
27
|
+
input_number = ComplexNumber(1, 0)
|
28
|
+
self.assertEqual(input_number.imaginary, 0)
|
29
|
+
|
30
|
+
def test_imaginary_part_of_a_purely_imaginary_number(self):
|
31
|
+
input_number = ComplexNumber(0, 1)
|
32
|
+
self.assertEqual(input_number.imaginary, 1)
|
33
|
+
|
34
|
+
def test_imaginary_part_of_a_number_with_real_and_imaginary_part(self):
|
35
|
+
input_number = ComplexNumber(1, 2)
|
36
|
+
self.assertEqual(input_number.imaginary, 2)
|
37
|
+
|
38
|
+
def test_imaginary_unit(self):
|
39
|
+
first_input = ComplexNumber(0, 1)
|
40
|
+
second_input = ComplexNumber(0, 1)
|
41
|
+
expected = ComplexNumber(-1, 0)
|
42
|
+
self.assertEqual(first_input * second_input, expected)
|
43
|
+
|
15
44
|
def test_add_purely_real_numbers(self):
|
16
45
|
first_input = ComplexNumber(1, 0)
|
17
46
|
second_input = ComplexNumber(2, 0)
|
@@ -120,30 +149,6 @@ class ComplexNumbersTest(unittest.TestCase):
|
|
120
149
|
self.assertEqual(input_number.conjugate().imaginary,
|
121
150
|
expected.imaginary)
|
122
151
|
|
123
|
-
def test_real_part_of_a_purely_real_number(self):
|
124
|
-
input_number = ComplexNumber(1, 0)
|
125
|
-
self.assertEqual(input_number.real, 1)
|
126
|
-
|
127
|
-
def test_real_part_of_a_purely_imaginary_number(self):
|
128
|
-
input_number = ComplexNumber(0, 1)
|
129
|
-
self.assertEqual(input_number.real, 0)
|
130
|
-
|
131
|
-
def test_real_part_of_a_number_with_real_and_imaginary_part(self):
|
132
|
-
input_number = ComplexNumber(1, 2)
|
133
|
-
self.assertEqual(input_number.real, 1)
|
134
|
-
|
135
|
-
def test_imaginary_part_of_a_purely_real_number(self):
|
136
|
-
input_number = ComplexNumber(1, 0)
|
137
|
-
self.assertEqual(input_number.imaginary, 0)
|
138
|
-
|
139
|
-
def test_imaginary_part_of_a_purely_imaginary_number(self):
|
140
|
-
input_number = ComplexNumber(0, 1)
|
141
|
-
self.assertEqual(input_number.imaginary, 1)
|
142
|
-
|
143
|
-
def test_imaginary_part_of_a_number_with_real_and_imaginary_part(self):
|
144
|
-
input_number = ComplexNumber(1, 2)
|
145
|
-
self.assertEqual(input_number.imaginary, 2)
|
146
|
-
|
147
152
|
def test_eulers_identity_formula(self):
|
148
153
|
input_number = ComplexNumber(0, math.pi)
|
149
154
|
expected = ComplexNumber(-1, 0)
|
@@ -162,6 +167,12 @@ class ComplexNumbersTest(unittest.TestCase):
|
|
162
167
|
self.assertEqual(input_number.exp().real, expected.real)
|
163
168
|
self.assertEqual(input_number.exp().imaginary, expected.imaginary)
|
164
169
|
|
170
|
+
def test_exponential_of_a_number_with_real_and_imaginary_part(self):
|
171
|
+
input_number = ComplexNumber(math.log(2), math.pi)
|
172
|
+
expected = ComplexNumber(-2, 0)
|
173
|
+
self.assertEqual(input_number.exp().real, expected.real)
|
174
|
+
self.assertEqual(input_number.exp().imaginary, expected.imaginary)
|
175
|
+
|
165
176
|
|
166
177
|
if __name__ == '__main__':
|
167
178
|
unittest.main()
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from custom_set import CustomSet
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.3.0
|
7
7
|
|
8
8
|
class CustomSetTest(unittest.TestCase):
|
9
9
|
def test_sets_with_no_elements_are_empty(self):
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from diamond import make_diamond
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
8
|
class DiamondTests(unittest.TestCase):
|
9
9
|
def test_degenerate_case_with_a_single_row(self):
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from dominoes import chain
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
|
7
7
|
|
8
8
|
class DominoesTest(unittest.TestCase):
|
9
9
|
def test_empty_input_empty_output(self):
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from forth import evaluate, StackUnderflowError
|
4
4
|
|
5
5
|
|
6
|
-
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.5.0
|
7
7
|
# Tests for case-insensitivity are track-specific
|
8
8
|
|
9
9
|
class ForthParsingTest(unittest.TestCase):
|
@@ -17,8 +17,16 @@ def verse(verse_num):
|
|
17
17
|
v.extend(['that {0} {1}'.format(parts[i][0], parts[i][1])
|
18
18
|
for i in range(verse_num - 1, -1, -1)])
|
19
19
|
v[-1] += '.'
|
20
|
-
return
|
20
|
+
return v
|
21
21
|
|
22
22
|
|
23
|
-
def
|
24
|
-
|
23
|
+
def recite(start_verse, end_verse):
|
24
|
+
if start_verse == end_verse:
|
25
|
+
return verse(start_verse - 1)
|
26
|
+
else:
|
27
|
+
result = []
|
28
|
+
for verse_num in range(start_verse-1, end_verse):
|
29
|
+
result.extend(verse(verse_num))
|
30
|
+
result.append("")
|
31
|
+
result.pop()
|
32
|
+
return result
|
@@ -2,127 +2,280 @@
|
|
2
2
|
|
3
3
|
import unittest
|
4
4
|
|
5
|
-
from house import
|
5
|
+
from house import recite
|
6
6
|
|
7
7
|
|
8
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
|
9
|
+
|
8
10
|
class VerseTest(unittest.TestCase):
|
9
|
-
def
|
10
|
-
expected =
|
11
|
-
self.assertEqual(
|
12
|
-
|
13
|
-
def
|
14
|
-
expected =
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
11
|
+
def test_verse_one(self):
|
12
|
+
expected = ["This is the house that Jack built."]
|
13
|
+
self.assertEqual(recite(1, 1), expected)
|
14
|
+
|
15
|
+
def test_verse_two(self):
|
16
|
+
expected = [
|
17
|
+
"This is the malt",
|
18
|
+
"that lay in the house that Jack built.",
|
19
|
+
]
|
20
|
+
self.assertEqual(recite(2, 2), expected)
|
21
|
+
|
22
|
+
def test_verse_three(self):
|
23
|
+
expected = [
|
24
|
+
"This is the rat",
|
25
|
+
"that ate the malt",
|
26
|
+
"that lay in the house that Jack built.",
|
27
|
+
]
|
28
|
+
self.assertEqual(recite(3, 3), expected)
|
29
|
+
|
30
|
+
def test_verse_four(self):
|
31
|
+
expected = [
|
32
|
+
"This is the cat",
|
33
|
+
"that killed the rat",
|
34
|
+
"that ate the malt",
|
35
|
+
"that lay in the house that Jack built.",
|
36
|
+
]
|
37
|
+
self.assertEqual(recite(4, 4), expected)
|
38
|
+
|
39
|
+
def test_verse_five(self):
|
40
|
+
expected = [
|
41
|
+
"This is the dog",
|
42
|
+
"that worried the cat",
|
43
|
+
"that killed the rat",
|
44
|
+
"that ate the malt",
|
45
|
+
"that lay in the house that Jack built.",
|
46
|
+
]
|
47
|
+
self.assertEqual(recite(5, 5), expected)
|
48
|
+
|
49
|
+
def test_verse_six(self):
|
50
|
+
expected = [
|
51
|
+
"This is the cow with the crumpled horn",
|
52
|
+
"that tossed the dog",
|
53
|
+
"that worried the cat",
|
54
|
+
"that killed the rat",
|
55
|
+
"that ate the malt",
|
56
|
+
"that lay in the house that Jack built.",
|
57
|
+
]
|
58
|
+
self.assertEqual(recite(6, 6), expected)
|
59
|
+
|
60
|
+
def test_verse_seven(self):
|
61
|
+
expected = [
|
62
|
+
"This is the maiden all forlorn",
|
63
|
+
"that milked the cow with the crumpled horn",
|
64
|
+
"that tossed the dog",
|
65
|
+
"that worried the cat",
|
66
|
+
"that killed the rat",
|
67
|
+
"that ate the malt",
|
68
|
+
"that lay in the house that Jack built.",
|
69
|
+
]
|
70
|
+
self.assertEqual(recite(7, 7), expected)
|
71
|
+
|
72
|
+
def test_verse_eight(self):
|
73
|
+
expected = [
|
74
|
+
"This is the man all tattered and torn",
|
75
|
+
"that kissed the maiden all forlorn",
|
76
|
+
"that milked the cow with the crumpled horn",
|
77
|
+
"that tossed the dog",
|
78
|
+
"that worried the cat",
|
79
|
+
"that killed the rat",
|
80
|
+
"that ate the malt",
|
81
|
+
"that lay in the house that Jack built.",
|
82
|
+
]
|
83
|
+
self.assertEqual(recite(8, 8), expected)
|
84
|
+
|
85
|
+
def test_verse_nine(self):
|
86
|
+
expected = [
|
87
|
+
"This is the priest all shaven and shorn",
|
88
|
+
"that married the man all tattered and torn",
|
89
|
+
"that kissed the maiden all forlorn",
|
90
|
+
"that milked the cow with the crumpled horn",
|
91
|
+
"that tossed the dog",
|
92
|
+
"that worried the cat",
|
93
|
+
"that killed the rat",
|
94
|
+
"that ate the malt",
|
95
|
+
"that lay in the house that Jack built.",
|
96
|
+
]
|
97
|
+
self.assertEqual(recite(9, 9), expected)
|
98
|
+
|
99
|
+
def test_verse_10(self):
|
100
|
+
expected = [
|
101
|
+
"This is the rooster that crowed in the morn",
|
102
|
+
"that woke the priest all shaven and shorn",
|
103
|
+
"that married the man all tattered and torn",
|
104
|
+
"that kissed the maiden all forlorn",
|
105
|
+
"that milked the cow with the crumpled horn",
|
106
|
+
"that tossed the dog",
|
107
|
+
"that worried the cat",
|
108
|
+
"that killed the rat",
|
109
|
+
"that ate the malt",
|
110
|
+
"that lay in the house that Jack built.",
|
111
|
+
]
|
112
|
+
self.assertEqual(recite(10, 10), expected)
|
30
113
|
|
31
114
|
def test_verse_11(self):
|
32
|
-
expected =
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
115
|
+
expected = [
|
116
|
+
"This is the farmer sowing his corn",
|
117
|
+
"that kept the rooster that crowed in the morn",
|
118
|
+
"that woke the priest all shaven and shorn",
|
119
|
+
"that married the man all tattered and torn",
|
120
|
+
"that kissed the maiden all forlorn",
|
121
|
+
"that milked the cow with the crumpled horn",
|
122
|
+
"that tossed the dog",
|
123
|
+
"that worried the cat",
|
124
|
+
"that killed the rat",
|
125
|
+
"that ate the malt",
|
126
|
+
"that lay in the house that Jack built.",
|
127
|
+
]
|
128
|
+
self.assertEqual(recite(11, 11), expected)
|
129
|
+
|
130
|
+
def test_verse_12(self):
|
131
|
+
expected = [
|
132
|
+
"This is the horse and the hound and the horn",
|
133
|
+
"that belonged to the farmer sowing his corn",
|
134
|
+
"that kept the rooster that crowed in the morn",
|
135
|
+
"that woke the priest all shaven and shorn",
|
136
|
+
"that married the man all tattered and torn",
|
137
|
+
"that kissed the maiden all forlorn",
|
138
|
+
"that milked the cow with the crumpled horn",
|
139
|
+
"that tossed the dog",
|
140
|
+
"that worried the cat",
|
141
|
+
"that killed the rat",
|
142
|
+
"that ate the malt",
|
143
|
+
"that lay in the house that Jack built.",
|
144
|
+
]
|
145
|
+
self.assertEqual(recite(12, 12), expected)
|
146
|
+
|
147
|
+
def test_multiple_verses(self):
|
148
|
+
expected = [
|
149
|
+
"This is the cat",
|
150
|
+
"that killed the rat",
|
151
|
+
"that ate the malt",
|
152
|
+
"that lay in the house that Jack built.",
|
153
|
+
"",
|
154
|
+
"This is the dog",
|
155
|
+
"that worried the cat",
|
156
|
+
"that killed the rat",
|
157
|
+
"that ate the malt",
|
158
|
+
"that lay in the house that Jack built.",
|
159
|
+
"",
|
160
|
+
"This is the cow with the crumpled horn",
|
161
|
+
"that tossed the dog",
|
162
|
+
"that worried the cat",
|
163
|
+
"that killed the rat",
|
164
|
+
"that ate the malt",
|
165
|
+
"that lay in the house that Jack built.",
|
166
|
+
"",
|
167
|
+
"This is the maiden all forlorn",
|
168
|
+
"that milked the cow with the crumpled horn",
|
169
|
+
"that tossed the dog",
|
170
|
+
"that worried the cat",
|
171
|
+
"that killed the rat",
|
172
|
+
"that ate the malt",
|
173
|
+
"that lay in the house that Jack built.",
|
174
|
+
"",
|
175
|
+
"This is the man all tattered and torn",
|
176
|
+
"that kissed the maiden all forlorn",
|
177
|
+
"that milked the cow with the crumpled horn",
|
178
|
+
"that tossed the dog",
|
179
|
+
"that worried the cat",
|
180
|
+
"that killed the rat",
|
181
|
+
"that ate the malt",
|
182
|
+
"that lay in the house that Jack built.",
|
183
|
+
]
|
184
|
+
self.assertEqual(recite(4, 8), expected)
|
185
|
+
|
186
|
+
def test_full_rhyme(self):
|
187
|
+
expected = [
|
188
|
+
"This is the house that Jack built.",
|
189
|
+
"",
|
190
|
+
"This is the malt",
|
191
|
+
"that lay in the house that Jack built.",
|
192
|
+
"",
|
193
|
+
"This is the rat",
|
194
|
+
"that ate the malt",
|
195
|
+
"that lay in the house that Jack built.",
|
196
|
+
"",
|
197
|
+
"This is the cat",
|
198
|
+
"that killed the rat",
|
199
|
+
"that ate the malt",
|
200
|
+
"that lay in the house that Jack built.",
|
201
|
+
"",
|
202
|
+
"This is the dog",
|
203
|
+
"that worried the cat",
|
204
|
+
"that killed the rat",
|
205
|
+
"that ate the malt",
|
206
|
+
"that lay in the house that Jack built.",
|
207
|
+
"",
|
208
|
+
"This is the cow with the crumpled horn",
|
209
|
+
"that tossed the dog",
|
210
|
+
"that worried the cat",
|
211
|
+
"that killed the rat",
|
212
|
+
"that ate the malt",
|
213
|
+
"that lay in the house that Jack built.",
|
214
|
+
"",
|
215
|
+
"This is the maiden all forlorn",
|
216
|
+
"that milked the cow with the crumpled horn",
|
217
|
+
"that tossed the dog",
|
218
|
+
"that worried the cat",
|
219
|
+
"that killed the rat",
|
220
|
+
"that ate the malt",
|
221
|
+
"that lay in the house that Jack built.",
|
222
|
+
"",
|
223
|
+
"This is the man all tattered and torn",
|
224
|
+
"that kissed the maiden all forlorn",
|
225
|
+
"that milked the cow with the crumpled horn",
|
226
|
+
"that tossed the dog",
|
227
|
+
"that worried the cat",
|
228
|
+
"that killed the rat",
|
229
|
+
"that ate the malt",
|
230
|
+
"that lay in the house that Jack built.",
|
231
|
+
"",
|
232
|
+
"This is the priest all shaven and shorn",
|
233
|
+
"that married the man all tattered and torn",
|
234
|
+
"that kissed the maiden all forlorn",
|
235
|
+
"that milked the cow with the crumpled horn",
|
236
|
+
"that tossed the dog",
|
237
|
+
"that worried the cat",
|
238
|
+
"that killed the rat",
|
239
|
+
"that ate the malt",
|
240
|
+
"that lay in the house that Jack built.",
|
241
|
+
"",
|
242
|
+
"This is the rooster that crowed in the morn",
|
243
|
+
"that woke the priest all shaven and shorn",
|
244
|
+
"that married the man all tattered and torn",
|
245
|
+
"that kissed the maiden all forlorn",
|
246
|
+
"that milked the cow with the crumpled horn",
|
247
|
+
"that tossed the dog",
|
248
|
+
"that worried the cat",
|
249
|
+
"that killed the rat",
|
250
|
+
"that ate the malt",
|
251
|
+
"that lay in the house that Jack built.",
|
252
|
+
"",
|
253
|
+
"This is the farmer sowing his corn",
|
254
|
+
"that kept the rooster that crowed in the morn",
|
255
|
+
"that woke the priest all shaven and shorn",
|
256
|
+
"that married the man all tattered and torn",
|
257
|
+
"that kissed the maiden all forlorn",
|
258
|
+
"that milked the cow with the crumpled horn",
|
259
|
+
"that tossed the dog",
|
260
|
+
"that worried the cat",
|
261
|
+
"that killed the rat",
|
262
|
+
"that ate the malt",
|
263
|
+
"that lay in the house that Jack built.",
|
264
|
+
"",
|
265
|
+
"This is the horse and the hound and the horn",
|
266
|
+
"that belonged to the farmer sowing his corn",
|
267
|
+
"that kept the rooster that crowed in the morn",
|
268
|
+
"that woke the priest all shaven and shorn",
|
269
|
+
"that married the man all tattered and torn",
|
270
|
+
"that kissed the maiden all forlorn",
|
271
|
+
"that milked the cow with the crumpled horn",
|
272
|
+
"that tossed the dog",
|
273
|
+
"that worried the cat",
|
274
|
+
"that killed the rat",
|
275
|
+
"that ate the malt",
|
276
|
+
"that lay in the house that Jack built.",
|
277
|
+
]
|
278
|
+
self.assertEqual(recite(1, 12), expected)
|
126
279
|
|
127
280
|
|
128
281
|
if __name__ == '__main__':
|