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
data/tracks/elm/config.json
CHANGED
@@ -354,7 +354,7 @@
|
|
354
354
|
]
|
355
355
|
},
|
356
356
|
{
|
357
|
-
"uuid": "
|
357
|
+
"uuid": "5f540090-061e-2f80-40a8-d9782700ed2efdf8965",
|
358
358
|
"slug": "isogram",
|
359
359
|
"core": false,
|
360
360
|
"unlocked_by": null,
|
@@ -362,6 +362,18 @@
|
|
362
362
|
"topics": [
|
363
363
|
"Lists"
|
364
364
|
]
|
365
|
+
},
|
366
|
+
{
|
367
|
+
"uuid": "1F9FE5BC-8213-44FD-B7D1-5D4CC7F3A475",
|
368
|
+
"slug": "binary-search",
|
369
|
+
"core": false,
|
370
|
+
"unlocked_by": null,
|
371
|
+
"difficulty": 7,
|
372
|
+
"topics": [
|
373
|
+
"algorithms",
|
374
|
+
"arrays",
|
375
|
+
"recursion"
|
376
|
+
]
|
365
377
|
}
|
366
378
|
],
|
367
379
|
"foregone": [
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module BinarySearch exposing (find)
|
2
|
+
|
3
|
+
import Array exposing (Array)
|
4
|
+
|
5
|
+
|
6
|
+
find : Int -> Array Int -> Int
|
7
|
+
find target xs =
|
8
|
+
find_ 0 (Array.length xs) target xs
|
9
|
+
|
10
|
+
|
11
|
+
find_ : Int -> Int -> Int -> Array Int -> Int
|
12
|
+
find_ i0 i1 target xs =
|
13
|
+
let
|
14
|
+
i =
|
15
|
+
(i1 + i0) // 2
|
16
|
+
|
17
|
+
isEqual =
|
18
|
+
Array.get i xs
|
19
|
+
|> (==) (Just target)
|
20
|
+
|
21
|
+
isLessThan =
|
22
|
+
Array.get i xs
|
23
|
+
|> Maybe.map ((<) target)
|
24
|
+
in
|
25
|
+
case ( isEqual, isLessThan, i0 > i1 ) of
|
26
|
+
( True, _, _ ) ->
|
27
|
+
i
|
28
|
+
|
29
|
+
( False, Just True, False ) ->
|
30
|
+
find_ i0 (i - 1) target xs
|
31
|
+
|
32
|
+
( False, Just False, False ) ->
|
33
|
+
find_ (i + 1) i1 target xs
|
34
|
+
|
35
|
+
_ ->
|
36
|
+
-1
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Binary Search
|
2
|
+
|
3
|
+
Implement a binary search algorithm.
|
4
|
+
|
5
|
+
Searching a sorted collection is a common task. A dictionary is a sorted
|
6
|
+
list of word definitions. Given a word, one can find its definition. A
|
7
|
+
telephone book is a sorted list of people's names, addresses, and
|
8
|
+
telephone numbers. Knowing someone's name allows one to quickly find
|
9
|
+
their telephone number and address.
|
10
|
+
|
11
|
+
If the list to be searched contains more than a few items (a dozen, say)
|
12
|
+
a binary search will require far fewer comparisons than a linear search,
|
13
|
+
but it imposes the requirement that the list be sorted.
|
14
|
+
|
15
|
+
In computer science, a binary search or half-interval search algorithm
|
16
|
+
finds the position of a specified input value (the search "key") within
|
17
|
+
an array sorted by key value.
|
18
|
+
|
19
|
+
In each step, the algorithm compares the search key value with the key
|
20
|
+
value of the middle element of the array.
|
21
|
+
|
22
|
+
If the keys match, then a matching element has been found and its index,
|
23
|
+
or position, is returned.
|
24
|
+
|
25
|
+
Otherwise, if the search key is less than the middle element's key, then
|
26
|
+
the algorithm repeats its action on the sub-array to the left of the
|
27
|
+
middle element or, if the search key is greater, on the sub-array to the
|
28
|
+
right.
|
29
|
+
|
30
|
+
If the remaining array to be searched is empty, then the key cannot be
|
31
|
+
found in the array and a special "not found" indication is returned.
|
32
|
+
|
33
|
+
A binary search halves the number of items to check with each iteration,
|
34
|
+
so locating an item (or determining its absence) takes logarithmic time.
|
35
|
+
A binary search is a dichotomic divide and conquer search algorithm.
|
36
|
+
|
37
|
+
## Elm Installation
|
38
|
+
|
39
|
+
Refer to the [Exercism help page](http://exercism.io/languages/elm) for Elm
|
40
|
+
installation and learning resources.
|
41
|
+
|
42
|
+
## Writing the Code
|
43
|
+
|
44
|
+
The first time you start an exercise, you'll need to ensure you have the
|
45
|
+
appropriate dependencies installed.
|
46
|
+
|
47
|
+
```bash
|
48
|
+
$ npm install
|
49
|
+
```
|
50
|
+
|
51
|
+
Execute the tests with:
|
52
|
+
|
53
|
+
```bash
|
54
|
+
$ npm test
|
55
|
+
```
|
56
|
+
|
57
|
+
Automatically run tests again when you save changes:
|
58
|
+
|
59
|
+
```bash
|
60
|
+
$ npm run watch
|
61
|
+
```
|
62
|
+
|
63
|
+
As you work your way through the test suite, be sure to remove the `skip <|`
|
64
|
+
calls from each test until you get them all passing!
|
65
|
+
|
66
|
+
## Source
|
67
|
+
|
68
|
+
Wikipedia [http://en.wikipedia.org/wiki/Binary_search_algorithm](http://en.wikipedia.org/wiki/Binary_search_algorithm)
|
69
|
+
|
70
|
+
## Submitting Incomplete Solutions
|
71
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"version": "1.0.0",
|
3
|
+
"summary": "helpful summary of your project, less than 80 characters",
|
4
|
+
"repository": "https://github.com/user/project.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
"."
|
8
|
+
],
|
9
|
+
"exposed-modules": [],
|
10
|
+
"dependencies": {
|
11
|
+
"elm-lang/core": "5.1.1 <= v < 6.0.0",
|
12
|
+
"elm-lang/html": "2.0.0 <= v < 3.0.0"
|
13
|
+
},
|
14
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
15
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Tests exposing (tests)
|
2
|
+
|
3
|
+
import Array
|
4
|
+
import BinarySearch exposing (find)
|
5
|
+
import Expect
|
6
|
+
import Fuzz exposing (Fuzzer)
|
7
|
+
import Test exposing (Test, describe, skip, test)
|
8
|
+
|
9
|
+
|
10
|
+
tests : Test
|
11
|
+
tests =
|
12
|
+
describe "binarySearch"
|
13
|
+
[ test "finds a value in an array with one element" <|
|
14
|
+
\() ->
|
15
|
+
Array.fromList [ 6 ]
|
16
|
+
|> find 6
|
17
|
+
|> Expect.equal 0
|
18
|
+
, skip <|
|
19
|
+
test "finds a value in the middle of an array" <|
|
20
|
+
\() ->
|
21
|
+
Array.fromList [ 1, 3, 4, 6, 8, 9, 11 ]
|
22
|
+
|> find 6
|
23
|
+
|> Expect.equal 3
|
24
|
+
, skip <|
|
25
|
+
test "finds a value at the beginning of an array" <|
|
26
|
+
\() ->
|
27
|
+
Array.fromList [ 1, 3, 4, 6, 8, 9, 11 ]
|
28
|
+
|> find 1
|
29
|
+
|> Expect.equal 0
|
30
|
+
, skip <|
|
31
|
+
test "finds a value in an array of odd length" <|
|
32
|
+
\() ->
|
33
|
+
Array.fromList [ 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634 ]
|
34
|
+
|> find 144
|
35
|
+
|> Expect.equal 9
|
36
|
+
, skip <|
|
37
|
+
test "finds a value in an array of even length" <|
|
38
|
+
\() ->
|
39
|
+
Array.fromList [ 1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377 ]
|
40
|
+
|> find 21
|
41
|
+
|> Expect.equal 5
|
42
|
+
, skip <|
|
43
|
+
test "identifies that a value is not included in the array" <|
|
44
|
+
\() ->
|
45
|
+
Array.fromList [ 1, 3, 4, 6, 8, 9, 11 ]
|
46
|
+
|> find 7
|
47
|
+
|> Expect.equal -1
|
48
|
+
, skip <|
|
49
|
+
test "a value smaller than the array's smallest value is not included" <|
|
50
|
+
\() ->
|
51
|
+
Array.fromList [ 1, 3, 4, 6, 8, 9, 11 ]
|
52
|
+
|> find 0
|
53
|
+
|> Expect.equal -1
|
54
|
+
, skip <|
|
55
|
+
test "a value larger than the array's largest value is not included" <|
|
56
|
+
\() ->
|
57
|
+
Array.fromList [ 1, 3, 4, 6, 8, 9, 11 ]
|
58
|
+
|> find 13
|
59
|
+
|> Expect.equal -1
|
60
|
+
, skip <|
|
61
|
+
test "nothing is included in an empty array" <|
|
62
|
+
\() ->
|
63
|
+
Array.empty
|
64
|
+
|> find 1
|
65
|
+
|> Expect.equal -1
|
66
|
+
]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"version": "1.0.0",
|
3
|
+
"summary": "helpful summary of your project, less than 80 characters",
|
4
|
+
"repository": "https://github.com/user/project.git",
|
5
|
+
"license": "BSD3",
|
6
|
+
"source-directories": [
|
7
|
+
".",
|
8
|
+
".."
|
9
|
+
],
|
10
|
+
"exposed-modules": [],
|
11
|
+
"dependencies": {
|
12
|
+
"elm-community/elm-test": "4.2.0 <= v < 5.0.0",
|
13
|
+
"elm-lang/core": "5.1.1 <= v < 6.0.0",
|
14
|
+
"elm-lang/html": "2.0.0 <= v < 3.0.0"
|
15
|
+
},
|
16
|
+
"elm-version": "0.18.0 <= v < 0.19.0"
|
17
|
+
}
|
@@ -3,12 +3,12 @@ module Hamming exposing (..)
|
|
3
3
|
import String exposing (length, toList)
|
4
4
|
|
5
5
|
|
6
|
-
distance : String -> String ->
|
6
|
+
distance : String -> String -> Result String Int
|
7
7
|
distance left right =
|
8
8
|
if length left /= length right then
|
9
|
-
|
9
|
+
Err "left and right strands must be of equal length"
|
10
10
|
else
|
11
11
|
List.map2 (\l r -> l /= r) (toList left) (toList right)
|
12
12
|
|> List.filter identity
|
13
13
|
|> List.length
|
14
|
-
|>
|
14
|
+
|> Ok
|
@@ -9,44 +9,44 @@ tests : Test
|
|
9
9
|
tests =
|
10
10
|
describe "Hamming"
|
11
11
|
[ test "identical strands" <|
|
12
|
-
\() -> Expect.equal (
|
12
|
+
\() -> Expect.equal (Ok 0) (distance "A" "A")
|
13
13
|
, skip <|
|
14
14
|
test "long identical strands" <|
|
15
|
-
\() -> Expect.equal (
|
15
|
+
\() -> Expect.equal (Ok 0) (distance "GGACTGA" "GGACTGA")
|
16
16
|
, skip <|
|
17
17
|
test "complete distance in single nucleotide strands" <|
|
18
|
-
\() -> Expect.equal (
|
18
|
+
\() -> Expect.equal (Ok 1) (distance "A" "G")
|
19
19
|
, skip <|
|
20
20
|
test "complete distance in small strands" <|
|
21
|
-
\() -> Expect.equal (
|
21
|
+
\() -> Expect.equal (Ok 2) (distance "AG" "CT")
|
22
22
|
, skip <|
|
23
23
|
test "small distance in small strands" <|
|
24
|
-
\() -> Expect.equal (
|
24
|
+
\() -> Expect.equal (Ok 1) (distance "AT" "CT")
|
25
25
|
, skip <|
|
26
26
|
test "small distance" <|
|
27
|
-
\() -> Expect.equal (
|
27
|
+
\() -> Expect.equal (Ok 1) (distance "GGACG" "GGTCG")
|
28
28
|
, skip <|
|
29
29
|
test "small distance in long strands" <|
|
30
|
-
\() -> Expect.equal (
|
30
|
+
\() -> Expect.equal (Ok 2) (distance "ACCAGGG" "ACTATGG")
|
31
31
|
, skip <|
|
32
32
|
test "non-unique character in first strand" <|
|
33
|
-
\() -> Expect.equal (
|
33
|
+
\() -> Expect.equal (Ok 1) (distance "AGA" "AGG")
|
34
34
|
, skip <|
|
35
35
|
test "non-unique character in second strand" <|
|
36
|
-
\() -> Expect.equal (
|
36
|
+
\() -> Expect.equal (Ok 1) (distance "AGG" "AGA")
|
37
37
|
, skip <|
|
38
38
|
test "large distance" <|
|
39
|
-
\() -> Expect.equal (
|
39
|
+
\() -> Expect.equal (Ok 4) (distance "GATACA" "GCATAA")
|
40
40
|
, skip <|
|
41
41
|
test "large distance in off-by-one strand" <|
|
42
|
-
\() -> Expect.equal (
|
42
|
+
\() -> Expect.equal (Ok 9) (distance "GGACGGATTCTG" "AGGACGGATTCT")
|
43
43
|
, skip <|
|
44
44
|
test "empty strands" <|
|
45
|
-
\() -> Expect.equal (
|
45
|
+
\() -> Expect.equal (Ok 0) (distance "" "")
|
46
46
|
, skip <|
|
47
47
|
test "disallow first strand longer" <|
|
48
|
-
\() -> Expect.equal
|
48
|
+
\() -> Expect.equal (Err "left and right strands must be of equal length") (distance "AATG" "AAA")
|
49
49
|
, skip <|
|
50
50
|
test "disallow second strand longer" <|
|
51
|
-
\() -> Expect.equal
|
51
|
+
\() -> Expect.equal (Err "left and right strands must be of equal length") (distance "ATA" "AGTG")
|
52
52
|
]
|