trackler 2.2.0.4 → 2.2.0.5
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/tracks/bash/config.json +10 -2
- data/tracks/bash/exercises/word-count/example.awk +12 -0
- data/tracks/bash/exercises/word-count/example.sh +21 -0
- data/tracks/c/config.json +0 -2
- data/tracks/ceylon/config.json +0 -2
- data/tracks/{erlang/exercises/all-your-base/.meta/readme.go.tmpl → clojure/config/exercise_readme.go.tmpl} +0 -1
- data/tracks/clojure/exercises/accumulate/README.md +35 -0
- data/tracks/clojure/exercises/acronym/README.md +15 -0
- data/tracks/clojure/exercises/all-your-base/README.md +35 -0
- data/tracks/clojure/exercises/allergies/README.md +37 -0
- data/tracks/clojure/exercises/anagram/README.md +13 -0
- data/tracks/clojure/exercises/atbash-cipher/README.md +34 -0
- data/tracks/clojure/exercises/bank-account/README.md +30 -0
- data/tracks/clojure/exercises/beer-song/README.md +327 -0
- data/tracks/clojure/exercises/binary/README.md +35 -0
- data/tracks/clojure/exercises/binary-search/README.md +41 -0
- data/tracks/clojure/exercises/binary-search-tree/README.md +60 -0
- data/tracks/clojure/exercises/bob/README.md +18 -0
- data/tracks/clojure/exercises/bracket-push/README.md +10 -0
- data/tracks/clojure/exercises/change/README.md +23 -0
- data/tracks/clojure/exercises/clock/README.md +13 -0
- data/tracks/clojure/exercises/crypto-square/README.md +74 -0
- data/tracks/clojure/exercises/difference-of-squares/README.md +19 -0
- data/tracks/clojure/exercises/etl/README.md +51 -0
- data/tracks/clojure/exercises/flatten-array/README.md +18 -0
- data/tracks/clojure/exercises/gigasecond/README.md +11 -0
- data/tracks/clojure/exercises/grade-school/README.md +42 -0
- data/tracks/clojure/exercises/grains/README.md +34 -0
- data/tracks/clojure/exercises/hamming/README.md +42 -0
- data/tracks/clojure/exercises/hello-world/README.md +51 -0
- data/tracks/clojure/exercises/hexadecimal/README.md +14 -0
- data/tracks/clojure/exercises/isogram/README.md +19 -0
- data/tracks/clojure/exercises/kindergarten-garden/README.md +66 -0
- data/tracks/clojure/exercises/largest-series-product/README.md +20 -0
- data/tracks/clojure/exercises/leap/README.md +33 -0
- data/tracks/clojure/exercises/luhn/README.md +71 -0
- data/tracks/clojure/exercises/meetup/README.md +30 -0
- data/tracks/clojure/exercises/minesweeper/README.md +30 -0
- data/tracks/clojure/exercises/nth-prime/README.md +15 -0
- data/tracks/clojure/exercises/nucleotide-count/README.md +33 -0
- data/tracks/clojure/exercises/octal/README.md +49 -0
- data/tracks/clojure/exercises/pangram/README.md +15 -0
- data/tracks/clojure/exercises/pascals-triangle/README.md +21 -0
- data/tracks/clojure/exercises/perfect-numbers/README.md +24 -0
- data/tracks/clojure/exercises/phone-number/README.md +34 -0
- data/tracks/clojure/exercises/pig-latin/README.md +24 -0
- data/tracks/clojure/exercises/pov/README.md +46 -0
- data/tracks/clojure/exercises/prime-factors/README.md +36 -0
- data/tracks/clojure/exercises/queen-attack/README.md +33 -0
- data/tracks/clojure/exercises/raindrops/README.md +24 -0
- data/tracks/clojure/exercises/rna-transcription/README.md +25 -0
- data/tracks/clojure/exercises/robot-name/README.md +22 -0
- data/tracks/clojure/exercises/robot-simulator/README.md +34 -0
- data/tracks/clojure/exercises/roman-numerals/README.md +49 -0
- data/tracks/clojure/exercises/rotational-cipher/README.md +36 -0
- data/tracks/clojure/exercises/scrabble-score/README.md +44 -0
- data/tracks/clojure/exercises/secret-handshake/README.md +35 -0
- data/tracks/clojure/exercises/sieve/README.md +34 -0
- data/tracks/clojure/exercises/space-age/README.md +24 -0
- data/tracks/clojure/exercises/strain/README.md +40 -0
- data/tracks/clojure/exercises/sublist/README.md +21 -0
- data/tracks/clojure/exercises/sum-of-multiples/README.md +18 -0
- data/tracks/clojure/exercises/triangle/README.md +26 -0
- data/tracks/clojure/exercises/trinary/README.md +28 -0
- data/tracks/clojure/exercises/word-count/README.md +19 -0
- data/tracks/clojure/exercises/wordy/README.md +63 -0
- data/tracks/{erlang/exercises/allergies/.meta/readme.go.tmpl → crystal/config/exercise_readme.go.tmpl} +0 -1
- data/tracks/crystal/config.json +0 -2
- data/tracks/crystal/exercises/acronym/README.md +38 -0
- data/tracks/crystal/exercises/anagram/README.md +36 -0
- data/tracks/crystal/exercises/atbash-cipher/README.md +57 -0
- data/tracks/crystal/exercises/binary/README.md +58 -0
- data/tracks/crystal/exercises/binary-search-tree/README.md +83 -0
- data/tracks/crystal/exercises/bob/README.md +41 -0
- data/tracks/crystal/exercises/bracket-push/README.md +33 -0
- data/tracks/crystal/exercises/difference-of-squares/README.md +42 -0
- data/tracks/crystal/exercises/flatten-array/README.md +41 -0
- data/tracks/crystal/exercises/forth/README.md +52 -0
- data/tracks/crystal/exercises/gigasecond/README.md +34 -0
- data/tracks/crystal/exercises/hamming/README.md +65 -0
- data/tracks/crystal/exercises/hello-world/README.md +78 -0
- data/tracks/crystal/exercises/largest-series-product/README.md +43 -0
- data/tracks/crystal/exercises/leap/README.md +56 -0
- data/tracks/crystal/exercises/pangram/README.md +38 -0
- data/tracks/crystal/exercises/pascals-triangle/README.md +44 -0
- data/tracks/crystal/exercises/raindrops/README.md +47 -0
- data/tracks/crystal/exercises/react/README.md +42 -0
- data/tracks/crystal/exercises/rna-transcription/README.md +48 -0
- data/tracks/crystal/exercises/roman-numerals/README.md +72 -0
- data/tracks/crystal/exercises/run-length-encoding/README.md +53 -0
- data/tracks/crystal/exercises/sieve/README.md +57 -0
- data/tracks/csharp/config.json +0 -2
- data/tracks/delphi/config.json +0 -2
- data/tracks/ecmascript/config.json +63 -2
- data/tracks/erlang/{exercises/anagram/.meta/readme.go.tmpl → config/exercise_readme.go.tmpl} +0 -1
- data/tracks/erlang/config.json +0 -2
- data/tracks/erlang/exercises/accumulate/README.md +0 -1
- data/tracks/erlang/exercises/all-your-base/README.md +0 -1
- data/tracks/erlang/exercises/allergies/README.md +0 -1
- data/tracks/erlang/exercises/anagram/README.md +0 -1
- data/tracks/erlang/exercises/atbash-cipher/README.md +0 -1
- data/tracks/erlang/exercises/bank-account/README.md +0 -1
- data/tracks/erlang/exercises/beer-song/README.md +0 -1
- data/tracks/erlang/exercises/bob/README.md +0 -1
- data/tracks/erlang/exercises/circular-buffer/README.md +0 -1
- data/tracks/erlang/exercises/clock/README.md +0 -1
- data/tracks/erlang/exercises/collatz-conjecture/README.md +0 -1
- data/tracks/erlang/exercises/difference-of-squares/README.md +0 -1
- data/tracks/erlang/exercises/etl/README.md +0 -1
- data/tracks/erlang/exercises/gigasecond/README.md +0 -1
- data/tracks/erlang/exercises/grade-school/README.md +0 -1
- data/tracks/erlang/exercises/grains/README.md +0 -1
- data/tracks/erlang/exercises/hamming/README.md +0 -1
- data/tracks/erlang/exercises/hello-world/README.md +0 -1
- data/tracks/erlang/exercises/largest-series-product/README.md +0 -1
- data/tracks/erlang/exercises/leap/README.md +0 -1
- data/tracks/erlang/exercises/luhn/README.md +0 -1
- data/tracks/erlang/exercises/meetup/README.md +0 -1
- data/tracks/erlang/exercises/nucleotide-count/README.md +0 -1
- data/tracks/erlang/exercises/parallel-letter-frequency/README.md +0 -1
- data/tracks/erlang/exercises/phone-number/README.md +0 -1
- data/tracks/erlang/exercises/rna-transcription/README.md +0 -1
- data/tracks/erlang/exercises/robot-simulator/README.md +0 -1
- data/tracks/erlang/exercises/roman-numerals/README.md +0 -1
- data/tracks/erlang/exercises/rotational-cipher/README.md +0 -1
- data/tracks/erlang/exercises/scrabble-score/README.md +0 -1
- data/tracks/erlang/exercises/series/README.md +0 -1
- data/tracks/erlang/exercises/space-age/README.md +0 -1
- data/tracks/erlang/exercises/spiral-matrix/README.md +0 -1
- data/tracks/erlang/exercises/strain/README.md +0 -1
- data/tracks/erlang/exercises/sum-of-multiples/README.md +0 -1
- data/tracks/erlang/exercises/triangle/README.md +0 -1
- data/tracks/erlang/exercises/word-count/README.md +0 -1
- data/tracks/erlang/exercises/zipper/README.md +0 -1
- data/tracks/factor/config.json +0 -2
- data/tracks/fsharp/config.json +0 -2
- data/tracks/go/config.json +12 -6
- data/tracks/go/exercises/bank-account/bank_account_test.go +60 -1
- data/tracks/go/exercises/error-handling/common.go +17 -0
- data/tracks/go/exercises/error-handling/error_handling_test.go +37 -4
- data/tracks/haskell/config.json +0 -2
- data/tracks/java/config.json +10 -2
- data/tracks/{erlang/exercises/accumulate → java/exercises/forth}/.meta/readme.go.tmpl +0 -0
- data/tracks/java/exercises/forth/README.md +41 -0
- data/tracks/java/exercises/forth/build.gradle +18 -0
- data/tracks/java/exercises/forth/src/example/java/ForthEvaluator.java +154 -0
- data/tracks/java/exercises/forth/src/example/java/Token.java +90 -0
- data/tracks/java/exercises/forth/src/main/java/.keep +0 -0
- data/tracks/java/exercises/forth/src/test/java/ForthEvaluatorTest.java +355 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/javascript/config.json +0 -2
- data/tracks/kotlin/config.json +30 -2
- data/tracks/kotlin/exercises/forth/README.md +32 -0
- data/tracks/kotlin/exercises/forth/build.gradle +28 -0
- data/tracks/kotlin/exercises/forth/src/example/kotlin/ForthEvaluator.kt +138 -0
- data/tracks/kotlin/exercises/forth/src/main/kotlin/.keep +0 -0
- data/tracks/kotlin/exercises/forth/src/test/kotlin/ForthEvaluatorTest.kt +352 -0
- data/tracks/kotlin/exercises/meetup/README.md +33 -0
- data/tracks/kotlin/exercises/meetup/build.gradle +28 -0
- data/tracks/kotlin/exercises/meetup/src/example/kotlin/Meetup.kt +45 -0
- data/tracks/kotlin/exercises/meetup/src/example/kotlin/MeetupSchedule.kt +1 -0
- data/tracks/kotlin/exercises/meetup/src/main/kotlin/MeetupSchedule.kt +5 -0
- data/tracks/kotlin/exercises/meetup/src/test/kotlin/MeetupTest.kt +771 -0
- data/tracks/kotlin/exercises/say/README.md +72 -0
- data/tracks/kotlin/exercises/say/build.gradle +28 -0
- data/tracks/kotlin/exercises/say/src/example/kotlin/NumberSpeller.kt +88 -0
- data/tracks/kotlin/exercises/say/src/main/kotlin/.keep +0 -0
- data/tracks/kotlin/exercises/say/src/test/kotlin/NumberSpellerTest.kt +138 -0
- data/tracks/kotlin/exercises/settings.gradle +3 -0
- data/tracks/lua/config.json +0 -2
- data/tracks/mips/config.json +0 -2
- data/tracks/ocaml/config.json +0 -2
- data/tracks/perl5/config.json +262 -67
- data/tracks/perl6/config.json +98 -26
- data/tracks/php/docs/INSTALLATION.md +1 -1
- data/tracks/powershell/config.json +0 -2
- data/tracks/purescript/config.json +0 -2
- data/tracks/python/README.md +2 -2
- data/tracks/python/config/exercise_readme.go.tmpl +16 -0
- data/tracks/python/config.json +280 -15
- data/tracks/python/exercises/accumulate/README.md +46 -0
- data/tracks/python/exercises/acronym/README.md +26 -0
- data/tracks/python/exercises/all-your-base/README.md +46 -0
- data/tracks/python/exercises/allergies/README.md +48 -0
- data/tracks/python/exercises/alphametics/README.md +46 -0
- data/tracks/python/exercises/anagram/README.md +24 -0
- data/tracks/python/exercises/atbash-cipher/README.md +45 -0
- data/tracks/python/exercises/beer-song/README.md +338 -0
- data/tracks/python/exercises/binary/README.md +46 -0
- data/tracks/python/exercises/binary-search/README.md +52 -0
- data/tracks/python/exercises/bob/README.md +29 -0
- data/tracks/python/exercises/book-store/README.md +85 -0
- data/tracks/python/exercises/bracket-push/README.md +21 -0
- data/tracks/python/exercises/circular-buffer/README.md +61 -0
- data/tracks/python/exercises/clock/README.md +24 -0
- data/tracks/python/exercises/crypto-square/README.md +85 -0
- data/tracks/python/exercises/diamond/README.md +70 -0
- data/tracks/python/exercises/difference-of-squares/README.md +30 -0
- data/tracks/python/exercises/etl/README.md +62 -0
- data/tracks/python/exercises/flatten-array/README.md +29 -0
- data/tracks/python/exercises/gigasecond/README.md +22 -0
- data/tracks/python/exercises/grade-school/README.md +53 -0
- data/tracks/python/exercises/grains/README.md +45 -0
- data/tracks/python/exercises/grep/README.md +82 -0
- data/tracks/python/exercises/hamming/README.md +53 -0
- data/tracks/python/exercises/hello-world/README.md +32 -0
- data/tracks/python/exercises/hexadecimal/README.md +25 -0
- data/tracks/python/exercises/house/README.md +124 -0
- data/tracks/python/exercises/isogram/README.md +30 -0
- data/tracks/python/exercises/kindergarten-garden/README.md +77 -0
- data/tracks/python/exercises/largest-series-product/README.md +31 -0
- data/tracks/python/exercises/leap/README.md +44 -0
- data/tracks/python/exercises/linked-list/README.md +45 -0
- data/tracks/python/exercises/list-ops/README.md +21 -0
- data/tracks/python/exercises/luhn/README.md +82 -0
- data/tracks/python/exercises/matrix/README.md +56 -0
- data/tracks/python/exercises/meetup/README.md +41 -0
- data/tracks/python/exercises/minesweeper/README.md +41 -0
- data/tracks/python/exercises/nth-prime/README.md +26 -0
- data/tracks/python/exercises/nucleotide-count/README.md +44 -0
- data/tracks/python/exercises/ocr-numbers/README.md +96 -0
- data/tracks/python/exercises/octal/README.md +60 -0
- data/tracks/python/exercises/palindrome-products/README.md +51 -0
- data/tracks/python/exercises/pangram/README.md +26 -0
- data/tracks/python/exercises/pascals-triangle/README.md +32 -0
- data/tracks/python/exercises/perfect-numbers/README.md +35 -0
- data/tracks/python/exercises/phone-number/README.md +45 -0
- data/tracks/python/exercises/pig-latin/README.md +35 -0
- data/tracks/python/exercises/point-mutations/README.md +52 -0
- data/tracks/python/exercises/poker/README.md +23 -0
- data/tracks/python/exercises/prime-factors/README.md +47 -0
- data/tracks/python/exercises/protein-translation/README.md +60 -0
- data/tracks/python/exercises/proverb/README.md +29 -0
- data/tracks/python/exercises/pythagorean-triplet/README.md +35 -0
- data/tracks/python/exercises/queen-attack/README.md +44 -0
- data/tracks/python/exercises/rail-fence-cipher/README.md +71 -0
- data/tracks/python/exercises/raindrops/README.md +35 -0
- data/tracks/python/exercises/rectangles/README.md +78 -0
- data/tracks/python/exercises/rna-transcription/README.md +36 -0
- data/tracks/python/exercises/robot-name/README.md +33 -0
- data/tracks/python/exercises/robot-simulator/README.md +45 -0
- data/tracks/python/exercises/roman-numerals/README.md +60 -0
- data/tracks/python/exercises/rotational-cipher/README.md +47 -0
- data/tracks/python/exercises/run-length-encoding/README.md +41 -0
- data/tracks/python/exercises/saddle-points/README.md +44 -0
- data/tracks/python/exercises/say/README.md +80 -0
- data/tracks/python/exercises/scale-generator/README.md +71 -0
- data/tracks/python/exercises/scrabble-score/README.md +55 -0
- data/tracks/python/exercises/secret-handshake/README.md +46 -0
- data/tracks/python/exercises/series/README.md +38 -0
- data/tracks/python/exercises/sieve/README.md +45 -0
- data/tracks/python/exercises/simple-cipher/README.md +101 -0
- data/tracks/python/exercises/space-age/README.md +35 -0
- data/tracks/python/exercises/strain/README.md +51 -0
- data/tracks/python/exercises/sublist/README.md +32 -0
- data/tracks/python/exercises/sum-of-multiples/README.md +29 -0
- data/tracks/python/exercises/tournament/README.md +79 -0
- data/tracks/python/exercises/transpose/README.md +76 -0
- data/tracks/python/exercises/triangle/README.md +37 -0
- data/tracks/python/exercises/trinary/README.md +39 -0
- data/tracks/python/exercises/twelve-days/README.md +46 -0
- data/tracks/python/exercises/variable-length-quantity/README.md +50 -0
- data/tracks/python/exercises/word-count/README.md +30 -0
- data/tracks/python/exercises/word-search/README.md +41 -0
- data/tracks/python/exercises/wordy/README.md +74 -0
- data/tracks/python/exercises/zebra-puzzle/README.md +43 -0
- data/tracks/python/test/check-exercises.py +2 -3
- data/tracks/r/config.json +0 -2
- data/tracks/ruby/.travis.yml +1 -1
- data/tracks/ruby/config/exercise_readme.go.tmpl +16 -0
- data/tracks/ruby/config.json +265 -4
- data/tracks/ruby/exercises/accumulate/README.md +76 -0
- data/tracks/ruby/exercises/acronym/README.md +41 -0
- data/tracks/ruby/exercises/all-your-base/README.md +61 -0
- data/tracks/ruby/exercises/allergies/README.md +63 -0
- data/tracks/ruby/exercises/alphametics/README.md +61 -0
- data/tracks/ruby/exercises/anagram/README.md +39 -0
- data/tracks/ruby/exercises/atbash-cipher/README.md +60 -0
- data/tracks/ruby/exercises/beer-song/README.md +353 -0
- data/tracks/ruby/exercises/binary/README.md +61 -0
- data/tracks/ruby/exercises/binary-search/README.md +67 -0
- data/tracks/ruby/exercises/binary-search-tree/README.md +86 -0
- data/tracks/ruby/exercises/bob/README.md +44 -0
- data/tracks/ruby/exercises/bowling/README.md +79 -0
- data/tracks/ruby/exercises/bracket-push/README.md +36 -0
- data/tracks/ruby/exercises/circular-buffer/README.md +76 -0
- data/tracks/ruby/exercises/clock/README.md +39 -0
- data/tracks/ruby/exercises/collatz-conjecture/README.md +59 -0
- data/tracks/ruby/exercises/connect/README.md +60 -0
- data/tracks/ruby/exercises/crypto-square/README.md +100 -0
- data/tracks/ruby/exercises/custom-set/README.md +37 -0
- data/tracks/ruby/exercises/diamond/README.md +85 -0
- data/tracks/ruby/exercises/difference-of-squares/README.md +45 -0
- data/tracks/ruby/exercises/dominoes/README.md +44 -0
- data/tracks/ruby/exercises/etl/README.md +77 -0
- data/tracks/ruby/exercises/flatten-array/README.md +44 -0
- data/tracks/ruby/exercises/food-chain/README.md +96 -0
- data/tracks/ruby/exercises/gigasecond/README.md +37 -0
- data/tracks/ruby/exercises/grade-school/README.md +68 -0
- data/tracks/ruby/exercises/grains/README.md +60 -0
- data/tracks/ruby/exercises/hamming/README.md +68 -0
- data/tracks/ruby/exercises/hello-world/README.md +47 -0
- data/tracks/ruby/exercises/hexadecimal/README.md +40 -0
- data/tracks/ruby/exercises/house/README.md +139 -0
- data/tracks/ruby/exercises/isogram/README.md +45 -0
- data/tracks/ruby/exercises/kindergarten-garden/README.md +92 -0
- data/tracks/ruby/exercises/largest-series-product/README.md +46 -0
- data/tracks/ruby/exercises/leap/README.md +59 -0
- data/tracks/ruby/exercises/linked-list/README.md +60 -0
- data/tracks/ruby/exercises/list-ops/README.md +36 -0
- data/tracks/ruby/exercises/luhn/README.md +97 -0
- data/tracks/ruby/exercises/matrix/README.md +71 -0
- data/tracks/ruby/exercises/meetup/README.md +56 -0
- data/tracks/ruby/exercises/minesweeper/README.md +56 -0
- data/tracks/ruby/exercises/nth-prime/README.md +41 -0
- data/tracks/ruby/exercises/nucleotide-count/README.md +59 -0
- data/tracks/ruby/exercises/ocr-numbers/README.md +111 -0
- data/tracks/ruby/exercises/octal/README.md +75 -0
- data/tracks/ruby/exercises/palindrome-products/README.md +66 -0
- data/tracks/ruby/exercises/pangram/README.md +41 -0
- data/tracks/ruby/exercises/pascals-triangle/README.md +47 -0
- data/tracks/ruby/exercises/perfect-numbers/README.md +50 -0
- data/tracks/ruby/exercises/phone-number/README.md +60 -0
- data/tracks/ruby/exercises/pig-latin/README.md +50 -0
- data/tracks/ruby/exercises/point-mutations/README.md +67 -0
- data/tracks/ruby/exercises/poker/README.md +38 -0
- data/tracks/ruby/exercises/prime-factors/README.md +62 -0
- data/tracks/ruby/exercises/protein-translation/README.md +75 -0
- data/tracks/ruby/exercises/proverb/README.md +44 -0
- data/tracks/ruby/exercises/pythagorean-triplet/README.md +50 -0
- data/tracks/ruby/exercises/queen-attack/README.md +59 -0
- data/tracks/ruby/exercises/rail-fence-cipher/README.md +86 -0
- data/tracks/ruby/exercises/raindrops/README.md +50 -0
- data/tracks/ruby/exercises/rna-transcription/README.md +51 -0
- data/tracks/ruby/exercises/robot-name/README.md +57 -0
- data/tracks/ruby/exercises/robot-simulator/README.md +60 -0
- data/tracks/ruby/exercises/roman-numerals/README.md +75 -0
- data/tracks/ruby/exercises/run-length-encoding/README.md +56 -0
- data/tracks/ruby/exercises/saddle-points/README.md +59 -0
- data/tracks/ruby/exercises/say/README.md +95 -0
- data/tracks/ruby/exercises/scale-generator/README.md +86 -0
- data/tracks/ruby/exercises/scrabble-score/README.md +70 -0
- data/tracks/ruby/exercises/secret-handshake/README.md +61 -0
- data/tracks/ruby/exercises/series/README.md +53 -0
- data/tracks/ruby/exercises/sieve/README.md +60 -0
- data/tracks/ruby/exercises/simple-cipher/README.md +116 -0
- data/tracks/ruby/exercises/simple-linked-list/README.md +54 -0
- data/tracks/ruby/exercises/space-age/README.md +50 -0
- data/tracks/ruby/exercises/strain/README.md +66 -0
- data/tracks/ruby/exercises/sum-of-multiples/README.md +44 -0
- data/tracks/ruby/exercises/tournament/README.md +94 -0
- data/tracks/ruby/exercises/transpose/README.md +91 -0
- data/tracks/ruby/exercises/triangle/README.md +52 -0
- data/tracks/ruby/exercises/trinary/README.md +54 -0
- data/tracks/ruby/exercises/twelve-days/README.md +61 -0
- data/tracks/ruby/exercises/two-bucket/README.md +62 -0
- data/tracks/ruby/exercises/word-count/README.md +45 -0
- data/tracks/ruby/exercises/wordy/README.md +89 -0
- data/tracks/rust/README.md +3 -3
- data/tracks/rust/_test/WINDOWS_README.md +44 -0
- data/tracks/rust/config.json +9 -2
- data/tracks/rust/exercises/pig-latin/Cargo-example.toml +8 -0
- data/tracks/rust/exercises/pig-latin/Cargo.lock +4 -0
- data/tracks/rust/exercises/pig-latin/Cargo.toml +6 -0
- data/tracks/rust/exercises/pig-latin/README.md +56 -0
- data/tracks/rust/exercises/pig-latin/example.rs +28 -0
- data/tracks/rust/exercises/pig-latin/tests/pig-latin.rs +120 -0
- data/tracks/rust/problem_ordering.md +2 -2
- data/tracks/sml/config.json +0 -2
- data/tracks/swift/config/exercise_readme.go.tmpl +16 -0
- data/tracks/swift/config.json +304 -79
- data/tracks/swift/exercises/accumulate/README.md +43 -0
- data/tracks/swift/exercises/acronym/README.md +23 -0
- data/tracks/swift/exercises/all-your-base/README.md +43 -0
- data/tracks/swift/exercises/allergies/README.md +45 -0
- data/tracks/swift/exercises/anagram/README.md +21 -0
- data/tracks/swift/exercises/atbash-cipher/README.md +42 -0
- data/tracks/swift/exercises/beer-song/README.md +335 -0
- data/tracks/swift/exercises/binary/README.md +43 -0
- data/tracks/swift/exercises/binary-search/README.md +49 -0
- data/tracks/swift/exercises/binary-search-tree/README.md +68 -0
- data/tracks/swift/exercises/bob/README.md +26 -0
- data/tracks/swift/exercises/bowling/README.md +61 -0
- data/tracks/swift/exercises/bracket-push/README.md +18 -0
- data/tracks/swift/exercises/clock/README.md +21 -0
- data/tracks/swift/exercises/crypto-square/README.md +82 -0
- data/tracks/swift/exercises/custom-set/README.md +19 -0
- data/tracks/swift/exercises/difference-of-squares/README.md +27 -0
- data/tracks/swift/exercises/dominoes/README.md +26 -0
- data/tracks/swift/exercises/etl/README.md +59 -0
- data/tracks/swift/exercises/flatten-array/README.md +26 -0
- data/tracks/swift/exercises/food-chain/README.md +78 -0
- data/tracks/swift/exercises/gigasecond/README.md +19 -0
- data/tracks/swift/exercises/grade-school/README.md +50 -0
- data/tracks/swift/exercises/grains/README.md +42 -0
- data/tracks/swift/exercises/hamming/README.md +50 -0
- data/tracks/swift/exercises/hello-world/README.md +29 -0
- data/tracks/swift/exercises/hexadecimal/README.md +22 -0
- data/tracks/swift/exercises/house/README.md +121 -0
- data/tracks/swift/exercises/isogram/README.md +27 -0
- data/tracks/swift/exercises/kindergarten-garden/README.md +74 -0
- data/tracks/swift/exercises/largest-series-product/README.md +28 -0
- data/tracks/swift/exercises/leap/README.md +41 -0
- data/tracks/swift/exercises/linked-list/README.md +42 -0
- data/tracks/swift/exercises/luhn/README.md +79 -0
- data/tracks/swift/exercises/matrix/README.md +53 -0
- data/tracks/swift/exercises/meetup/README.md +38 -0
- data/tracks/swift/exercises/minesweeper/README.md +38 -0
- data/tracks/swift/exercises/nth-prime/README.md +23 -0
- data/tracks/swift/exercises/nucleotide-count/README.md +41 -0
- data/tracks/swift/exercises/ocr-numbers/README.md +93 -0
- data/tracks/swift/exercises/octal/README.md +57 -0
- data/tracks/swift/exercises/palindrome-products/README.md +48 -0
- data/tracks/swift/exercises/pangram/README.md +23 -0
- data/tracks/swift/exercises/pascals-triangle/README.md +29 -0
- data/tracks/swift/exercises/perfect-numbers/README.md +32 -0
- data/tracks/swift/exercises/phone-number/README.md +42 -0
- data/tracks/swift/exercises/pig-latin/README.md +32 -0
- data/tracks/swift/exercises/poker/README.md +20 -0
- data/tracks/swift/exercises/prime-factors/README.md +44 -0
- data/tracks/swift/exercises/pythagorean-triplet/README.md +32 -0
- data/tracks/swift/exercises/queen-attack/README.md +41 -0
- data/tracks/swift/exercises/raindrops/README.md +32 -0
- data/tracks/swift/exercises/rna-transcription/README.md +33 -0
- data/tracks/swift/exercises/robot-name/README.md +30 -0
- data/tracks/swift/exercises/robot-simulator/README.md +42 -0
- data/tracks/swift/exercises/roman-numerals/README.md +57 -0
- data/tracks/swift/exercises/run-length-encoding/README.md +38 -0
- data/tracks/swift/exercises/saddle-points/README.md +41 -0
- data/tracks/swift/exercises/scrabble-score/README.md +52 -0
- data/tracks/swift/exercises/secret-handshake/README.md +43 -0
- data/tracks/swift/exercises/series/README.md +35 -0
- data/tracks/swift/exercises/sieve/README.md +42 -0
- data/tracks/swift/exercises/simple-cipher/README.md +98 -0
- data/tracks/swift/exercises/simple-linked-list/README.md +36 -0
- data/tracks/swift/exercises/space-age/README.md +32 -0
- data/tracks/swift/exercises/strain/README.md +48 -0
- data/tracks/swift/exercises/sublist/README.md +29 -0
- data/tracks/swift/exercises/sum-of-multiples/README.md +26 -0
- data/tracks/swift/exercises/tournament/README.md +76 -0
- data/tracks/swift/exercises/transpose/README.md +73 -0
- data/tracks/swift/exercises/triangle/README.md +34 -0
- data/tracks/swift/exercises/trinary/README.md +36 -0
- data/tracks/swift/exercises/twelve-days/README.md +43 -0
- data/tracks/swift/exercises/word-count/README.md +27 -0
- data/tracks/swift/exercises/wordy/README.md +71 -0
- data/tracks/typescript/README.md +1 -1
- data/tracks/typescript/config.json +63 -3
- data/tracks/vimscript/config.json +0 -2
- metadata +371 -40
- data/tracks/erlang/exercises/atbash-cipher/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/bank-account/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/beer-song/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/bob/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/circular-buffer/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/clock/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/collatz-conjecture/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/difference-of-squares/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/etl/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/gigasecond/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/grade-school/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/grains/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/hamming/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/hello-world/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/largest-series-product/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/leap/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/luhn/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/meetup/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/nucleotide-count/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/parallel-letter-frequency/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/phone-number/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/rna-transcription/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/robot-simulator/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/roman-numerals/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/rotational-cipher/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/scrabble-score/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/series/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/space-age/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/spiral-matrix/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/strain/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/sum-of-multiples/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/triangle/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/word-count/.meta/readme.go.tmpl +0 -17
- data/tracks/erlang/exercises/zipper/.meta/readme.go.tmpl +0 -17
@@ -0,0 +1,44 @@
|
|
1
|
+
# Saddle Points
|
2
|
+
|
3
|
+
Detect saddle points in a matrix.
|
4
|
+
|
5
|
+
So say you have a matrix like so:
|
6
|
+
|
7
|
+
```plain
|
8
|
+
0 1 2
|
9
|
+
|---------
|
10
|
+
0 | 9 8 7
|
11
|
+
1 | 5 3 2 <--- saddle point at (1,0)
|
12
|
+
2 | 6 6 7
|
13
|
+
```
|
14
|
+
|
15
|
+
It has a saddle point at (1, 0).
|
16
|
+
|
17
|
+
It's called a "saddle point" because it is greater than or equal to
|
18
|
+
every element in its row and the less than or equal to every element in
|
19
|
+
its column.
|
20
|
+
|
21
|
+
A matrix may have zero or more saddle points.
|
22
|
+
|
23
|
+
Your code should be able to provide the (possibly empty) list of all the
|
24
|
+
saddle points for any given matrix.
|
25
|
+
|
26
|
+
Note that you may find other definitions of matrix saddle points online,
|
27
|
+
but the tests for this exercise follow the above unambiguous definition.
|
28
|
+
|
29
|
+
### Submitting Exercises
|
30
|
+
|
31
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
32
|
+
|
33
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
34
|
+
|
35
|
+
|
36
|
+
For more detailed information about running tests, code style and linting,
|
37
|
+
please see the [help page](http://exercism.io/languages/python).
|
38
|
+
|
39
|
+
## Source
|
40
|
+
|
41
|
+
J Dalbey's Programming Practice problems [http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html](http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html)
|
42
|
+
|
43
|
+
## Submitting Incomplete Solutions
|
44
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# Say
|
2
|
+
|
3
|
+
Given a number from 0 to 999,999,999,999, spell out that number in English.
|
4
|
+
|
5
|
+
## Step 1
|
6
|
+
|
7
|
+
Handle the basic case of 0 through 99.
|
8
|
+
|
9
|
+
If the input to the program is `22`, then the output should be
|
10
|
+
`'twenty-two'`.
|
11
|
+
|
12
|
+
Your program should complain loudly if given a number outside the
|
13
|
+
blessed range.
|
14
|
+
|
15
|
+
Some good test cases for this program are:
|
16
|
+
|
17
|
+
- 0
|
18
|
+
- 14
|
19
|
+
- 50
|
20
|
+
- 98
|
21
|
+
- -1
|
22
|
+
- 100
|
23
|
+
|
24
|
+
### Extension
|
25
|
+
|
26
|
+
If you're on a Mac, shell out to Mac OS X's `say` program to talk out
|
27
|
+
loud.
|
28
|
+
|
29
|
+
## Step 2
|
30
|
+
|
31
|
+
Implement breaking a number up into chunks of thousands.
|
32
|
+
|
33
|
+
So `1234567890` should yield a list like 1, 234, 567, and 890, while the
|
34
|
+
far simpler `1000` should yield just 1 and 0.
|
35
|
+
|
36
|
+
The program must also report any values that are out of range.
|
37
|
+
|
38
|
+
## Step 3
|
39
|
+
|
40
|
+
Now handle inserting the appropriate scale word between those chunks.
|
41
|
+
|
42
|
+
So `1234567890` should yield `'1 billion 234 million 567 thousand 890'`
|
43
|
+
|
44
|
+
The program must also report any values that are out of range. It's
|
45
|
+
fine to stop at "trillion".
|
46
|
+
|
47
|
+
## Step 4
|
48
|
+
|
49
|
+
Put it all together to get nothing but plain English.
|
50
|
+
|
51
|
+
`12345` should give `twelve thousand three hundred forty-five`.
|
52
|
+
|
53
|
+
The program must also report any values that are out of range.
|
54
|
+
|
55
|
+
### Extensions
|
56
|
+
|
57
|
+
Use _and_ (correctly) when spelling out the number in English:
|
58
|
+
|
59
|
+
- 14 becomes "fourteen".
|
60
|
+
- 100 becomes "one hundred".
|
61
|
+
- 120 becomes "one hundred and twenty".
|
62
|
+
- 1002 becomes "one thousand and two".
|
63
|
+
- 1323 becomes "one thousand three hundred and twenty-three".
|
64
|
+
|
65
|
+
### Submitting Exercises
|
66
|
+
|
67
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
68
|
+
|
69
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
70
|
+
|
71
|
+
|
72
|
+
For more detailed information about running tests, code style and linting,
|
73
|
+
please see the [help page](http://exercism.io/languages/python).
|
74
|
+
|
75
|
+
## Source
|
76
|
+
|
77
|
+
A variation on JavaRanch CattleDrive, exercise 4a [http://www.javaranch.com/say.jsp](http://www.javaranch.com/say.jsp)
|
78
|
+
|
79
|
+
## Submitting Incomplete Solutions
|
80
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Scale Generator
|
2
|
+
|
3
|
+
Given a tonic, or starting note, and a set of intervals, generate
|
4
|
+
the musical scale starting with the tonic and following the
|
5
|
+
specified interval pattern.
|
6
|
+
|
7
|
+
Scales in Western music are based on the chromatic (12-note) scale.This
|
8
|
+
scale can be expressed as the following group of pitches:
|
9
|
+
|
10
|
+
A, A#, B, C, C#, D, D#, E, F, F#, G, G#
|
11
|
+
|
12
|
+
A given sharp note (indicated by a #), can also be expressed as the flat
|
13
|
+
of the note above it (indicated by a b), so the chromatic scale can also be
|
14
|
+
written like this:
|
15
|
+
|
16
|
+
A, Bb, B, C, Db, D, Eb, E, F, Gb, G, Ab
|
17
|
+
|
18
|
+
The major and minor scale and modes are subsets of this twelve-pitch
|
19
|
+
collection. They have seven pitches, and are called diatonic scales.
|
20
|
+
The collection of notes in these scales is written with either sharps or
|
21
|
+
flats, depending on the tonic. Here is a list of which are which:
|
22
|
+
|
23
|
+
No Accidentals:
|
24
|
+
C major
|
25
|
+
A minor
|
26
|
+
|
27
|
+
Use Sharps:
|
28
|
+
G, D, A, E, B, F# major
|
29
|
+
e, b, f#, c#, g#, d# minor
|
30
|
+
|
31
|
+
Use Flats:
|
32
|
+
F, Bb, Eb, Ab, Db, Gb major
|
33
|
+
d, g, c, f, bb, eb minor
|
34
|
+
|
35
|
+
|
36
|
+
The diatonic scales, and all other scales that derive from the
|
37
|
+
chromatic scale, are built upon intervals. An interval is the space
|
38
|
+
between two pitches.
|
39
|
+
|
40
|
+
The simplest interval is between two adjacent notes, and is called a
|
41
|
+
"half step", or "minor second" (sometimes written as a lower-case "m").
|
42
|
+
The interval between two notes that have an interceding note is called
|
43
|
+
a "whole step" or "major second" (written as an upper-case "M"). The
|
44
|
+
diatonic scales are built using only these two intervals between
|
45
|
+
adjacent notes.
|
46
|
+
|
47
|
+
Non-diatonic scales can contain the same letter twice, and can contain other intervals.
|
48
|
+
Sometimes they may be smaller than usual (diminished, written "D"), or larger
|
49
|
+
(augmented, written "A"). Intervals larger than an augmented second have other names.
|
50
|
+
|
51
|
+
Here is a table of pitches with the names of their interval distance from the tonic (A).
|
52
|
+
|
53
|
+
| A | A# | B | C | C# | D | D# | E | F | F# | G | G# | A |
|
54
|
+
|:------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:------:|
|
55
|
+
| Unison | Min 2nd | Maj 2nd | Min 3rd | Maj 3rd | Per 4th | Tritone | Per 5th | Min 6th | Maj 6th | Min 7th | Maj 7th | Octave |
|
56
|
+
| | | Dim 3rd | Aug 2nd | Dim 4th | | Aug 4th | Dim 5th | Aug 5th | Dim 7th | Aug 6th | Dim 8ve | |
|
57
|
+
| | | | | | | Dim 5th | | | | | | |
|
58
|
+
|
59
|
+
### Submitting Exercises
|
60
|
+
|
61
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
62
|
+
|
63
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
64
|
+
|
65
|
+
|
66
|
+
For more detailed information about running tests, code style and linting,
|
67
|
+
please see the [help page](http://exercism.io/languages/python).
|
68
|
+
|
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,55 @@
|
|
1
|
+
# Scrabble Score
|
2
|
+
|
3
|
+
Given a word, compute the scrabble score for that word.
|
4
|
+
|
5
|
+
## Letter Values
|
6
|
+
|
7
|
+
You'll need these:
|
8
|
+
|
9
|
+
```plain
|
10
|
+
Letter Value
|
11
|
+
A, E, I, O, U, L, N, R, S, T 1
|
12
|
+
D, G 2
|
13
|
+
B, C, M, P 3
|
14
|
+
F, H, V, W, Y 4
|
15
|
+
K 5
|
16
|
+
J, X 8
|
17
|
+
Q, Z 10
|
18
|
+
```
|
19
|
+
|
20
|
+
## Examples
|
21
|
+
"cabbage" should be scored as worth 14 points:
|
22
|
+
|
23
|
+
- 3 points for C
|
24
|
+
- 1 point for A, twice
|
25
|
+
- 3 points for B, twice
|
26
|
+
- 2 points for G
|
27
|
+
- 1 point for E
|
28
|
+
|
29
|
+
And to total:
|
30
|
+
|
31
|
+
- `3 + 2*1 + 2*3 + 2 + 1`
|
32
|
+
- = `3 + 2 + 6 + 3`
|
33
|
+
- = `5 + 9`
|
34
|
+
- = 14
|
35
|
+
|
36
|
+
## Extensions
|
37
|
+
- You can play a double or a triple letter.
|
38
|
+
- You can play a double or a triple word.
|
39
|
+
|
40
|
+
### Submitting Exercises
|
41
|
+
|
42
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
43
|
+
|
44
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
45
|
+
|
46
|
+
|
47
|
+
For more detailed information about running tests, code style and linting,
|
48
|
+
please see the [help page](http://exercism.io/languages/python).
|
49
|
+
|
50
|
+
## Source
|
51
|
+
|
52
|
+
Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup)
|
53
|
+
|
54
|
+
## Submitting Incomplete Solutions
|
55
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Secret Handshake
|
2
|
+
|
3
|
+
> There are 10 types of people in the world: Those who understand
|
4
|
+
> binary, and those who don't.
|
5
|
+
|
6
|
+
You and your fellow cohort of those in the "know" when it comes to
|
7
|
+
binary decide to come up with a secret "handshake".
|
8
|
+
|
9
|
+
```
|
10
|
+
1 = wink
|
11
|
+
10 = double blink
|
12
|
+
100 = close your eyes
|
13
|
+
1000 = jump
|
14
|
+
|
15
|
+
|
16
|
+
10000 = Reverse the order of the operations in the secret handshake.
|
17
|
+
```
|
18
|
+
|
19
|
+
Given a decimal number, convert it to the appropriate sequence of events for a secret handshake.
|
20
|
+
|
21
|
+
Here's a couple of examples:
|
22
|
+
|
23
|
+
Given the input 3, the function would return the array
|
24
|
+
["wink", "double blink"] because 3 is 11 in binary.
|
25
|
+
|
26
|
+
Given the input 19, the function would return the array
|
27
|
+
["double blink", "wink"] because 19 is 10011 in binary.
|
28
|
+
Notice that the addition of 16 (10000 in binary)
|
29
|
+
has caused the array to be reversed.
|
30
|
+
|
31
|
+
### Submitting Exercises
|
32
|
+
|
33
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
34
|
+
|
35
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
36
|
+
|
37
|
+
|
38
|
+
For more detailed information about running tests, code style and linting,
|
39
|
+
please see the [help page](http://exercism.io/languages/python).
|
40
|
+
|
41
|
+
## Source
|
42
|
+
|
43
|
+
Bert, in Mary Poppins [http://www.imdb.com/character/ch0011238/quotes](http://www.imdb.com/character/ch0011238/quotes)
|
44
|
+
|
45
|
+
## Submitting Incomplete Solutions
|
46
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# Series
|
2
|
+
|
3
|
+
Given a string of digits, output all the contiguous substrings of length `n` in
|
4
|
+
that string.
|
5
|
+
|
6
|
+
For example, the string "49142" has the following 3-digit series:
|
7
|
+
|
8
|
+
- 491
|
9
|
+
- 914
|
10
|
+
- 142
|
11
|
+
|
12
|
+
And the following 4-digit series:
|
13
|
+
|
14
|
+
- 4914
|
15
|
+
- 9142
|
16
|
+
|
17
|
+
And if you ask for a 6-digit series from a 5-digit string, you deserve
|
18
|
+
whatever you get.
|
19
|
+
|
20
|
+
Note that these series are only required to occupy *adjacent positions*
|
21
|
+
in the input; the digits need not be *numerically consecutive*.
|
22
|
+
|
23
|
+
### Submitting Exercises
|
24
|
+
|
25
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
26
|
+
|
27
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
28
|
+
|
29
|
+
|
30
|
+
For more detailed information about running tests, code style and linting,
|
31
|
+
please see the [help page](http://exercism.io/languages/python).
|
32
|
+
|
33
|
+
## Source
|
34
|
+
|
35
|
+
A subset of the Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8)
|
36
|
+
|
37
|
+
## Submitting Incomplete Solutions
|
38
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# Sieve
|
2
|
+
|
3
|
+
Use the Sieve of Eratosthenes to find all the primes from 2 up to a given
|
4
|
+
number.
|
5
|
+
|
6
|
+
The Sieve of Eratosthenes is a simple, ancient algorithm for finding all
|
7
|
+
prime numbers up to any given limit. It does so by iteratively marking as
|
8
|
+
composite (i.e. not prime) the multiples of each prime,
|
9
|
+
starting with the multiples of 2.
|
10
|
+
|
11
|
+
Create your range, starting at two and continuing up to and including the given limit. (i.e. [2, limit])
|
12
|
+
|
13
|
+
The algorithm consists of repeating the following over and over:
|
14
|
+
|
15
|
+
- take the next available unmarked number in your list (it is prime)
|
16
|
+
- mark all the multiples of that number (they are not prime)
|
17
|
+
|
18
|
+
Repeat until you have processed each number in your range.
|
19
|
+
|
20
|
+
When the algorithm terminates, all the numbers in the list that have not
|
21
|
+
been marked are prime.
|
22
|
+
|
23
|
+
The wikipedia article has a useful graphic that explains the algorithm:
|
24
|
+
https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
|
25
|
+
|
26
|
+
Notice that this is a very specific algorithm, and the tests don't check
|
27
|
+
that you've implemented the algorithm, only that you've come up with the
|
28
|
+
correct list of primes.
|
29
|
+
|
30
|
+
### Submitting Exercises
|
31
|
+
|
32
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
33
|
+
|
34
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
35
|
+
|
36
|
+
|
37
|
+
For more detailed information about running tests, code style and linting,
|
38
|
+
please see the [help page](http://exercism.io/languages/python).
|
39
|
+
|
40
|
+
## Source
|
41
|
+
|
42
|
+
Sieve of Eratosthenes at Wikipedia [http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
|
43
|
+
|
44
|
+
## Submitting Incomplete Solutions
|
45
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,101 @@
|
|
1
|
+
# Simple Cipher
|
2
|
+
|
3
|
+
Implement a simple shift cipher like Caesar and a more secure substitution cipher.
|
4
|
+
|
5
|
+
## Step 1
|
6
|
+
|
7
|
+
"If he had anything confidential to say, he wrote it in cipher, that is,
|
8
|
+
by so changing the order of the letters of the alphabet, that not a word
|
9
|
+
could be made out. If anyone wishes to decipher these, and get at their
|
10
|
+
meaning, he must substitute the fourth letter of the alphabet, namely D,
|
11
|
+
for A, and so with the others."
|
12
|
+
—Suetonius, Life of Julius Caesar
|
13
|
+
|
14
|
+
Ciphers are very straight-forward algorithms that allow us to render
|
15
|
+
text less readable while still allowing easy deciphering. They are
|
16
|
+
vulnerable to many forms of cryptoanalysis, but we are lucky that
|
17
|
+
generally our little sisters are not cryptoanalysts.
|
18
|
+
|
19
|
+
The Caesar Cipher was used for some messages from Julius Caesar that
|
20
|
+
were sent afield. Now Caesar knew that the cipher wasn't very good, but
|
21
|
+
he had one ally in that respect: almost nobody could read well. So even
|
22
|
+
being a couple letters off was sufficient so that people couldn't
|
23
|
+
recognize the few words that they did know.
|
24
|
+
|
25
|
+
Your task is to create a simple shift cipher like the Caesar Cipher.
|
26
|
+
This image is a great example of the Caesar Cipher:
|
27
|
+
|
28
|
+
![Caesar Cipher][1]
|
29
|
+
|
30
|
+
For example:
|
31
|
+
|
32
|
+
Giving "iamapandabear" as input to the encode function returns the cipher "ldpdsdqgdehdu". Obscure enough to keep our message secret in transit.
|
33
|
+
|
34
|
+
When "ldpdsdqgdehdu" is put into the decode function it would return
|
35
|
+
the original "iamapandabear" letting your friend read your original
|
36
|
+
message.
|
37
|
+
|
38
|
+
## Step 2
|
39
|
+
|
40
|
+
Shift ciphers are no fun though when your kid sister figures it out. Try
|
41
|
+
amending the code to allow us to specify a key and use that for the
|
42
|
+
shift distance. This is called a substitution cipher.
|
43
|
+
|
44
|
+
Here's an example:
|
45
|
+
|
46
|
+
Given the key "aaaaaaaaaaaaaaaaaa", encoding the string "iamapandabear"
|
47
|
+
would return the original "iamapandabear".
|
48
|
+
|
49
|
+
Given the key "ddddddddddddddddd", encoding our string "iamapandabear"
|
50
|
+
would return the obscured "lpdsdqgdehdu"
|
51
|
+
|
52
|
+
In the example above, we've set a = 0 for the key value. So when the
|
53
|
+
plaintext is added to the key, we end up with the same message coming
|
54
|
+
out. So "aaaa" is not an ideal key. But if we set the key to "dddd", we
|
55
|
+
would get the same thing as the Caesar Cipher.
|
56
|
+
|
57
|
+
## Step 3
|
58
|
+
|
59
|
+
The weakest link in any cipher is the human being. Let's make your
|
60
|
+
substitution cipher a little more fault tolerant by providing a source
|
61
|
+
of randomness and ensuring that the key is not composed of numbers or
|
62
|
+
capital letters.
|
63
|
+
|
64
|
+
If someone doesn't submit a key at all, generate a truly random key of
|
65
|
+
at least 100 characters in length, accessible via Cipher#key (the #
|
66
|
+
syntax means instance variable)
|
67
|
+
|
68
|
+
If the key submitted has capital letters or numbers, throw an
|
69
|
+
ArgumentError with a message to that effect.
|
70
|
+
|
71
|
+
## Extensions
|
72
|
+
|
73
|
+
Shift ciphers work by making the text slightly odd, but are vulnerable
|
74
|
+
to frequency analysis. Substitution ciphers help that, but are still
|
75
|
+
very vulnerable when the key is short or if spaces are preserved. Later
|
76
|
+
on you'll see one solution to this problem in the exercise
|
77
|
+
"crypto-square".
|
78
|
+
|
79
|
+
If you want to go farther in this field, the questions begin to be about
|
80
|
+
how we can exchange keys in a secure way. Take a look at [Diffie-Hellman
|
81
|
+
on Wikipedia][dh] for one of the first implementations of this scheme.
|
82
|
+
|
83
|
+
[1]: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Caesar_cipher_left_shift_of_3.svg/320px-Caesar_cipher_left_shift_of_3.svg.png
|
84
|
+
[dh]: http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange
|
85
|
+
|
86
|
+
### Submitting Exercises
|
87
|
+
|
88
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
89
|
+
|
90
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
91
|
+
|
92
|
+
|
93
|
+
For more detailed information about running tests, code style and linting,
|
94
|
+
please see the [help page](http://exercism.io/languages/python).
|
95
|
+
|
96
|
+
## Source
|
97
|
+
|
98
|
+
Substitution Cipher at Wikipedia [http://en.wikipedia.org/wiki/Substitution_cipher](http://en.wikipedia.org/wiki/Substitution_cipher)
|
99
|
+
|
100
|
+
## Submitting Incomplete Solutions
|
101
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Space Age
|
2
|
+
|
3
|
+
Given an age in seconds, calculate how old someone would be on:
|
4
|
+
|
5
|
+
- Earth: orbital period 365.25 Earth days, or 31557600 seconds
|
6
|
+
- Mercury: orbital period 0.2408467 Earth years
|
7
|
+
- Venus: orbital period 0.61519726 Earth years
|
8
|
+
- Mars: orbital period 1.8808158 Earth years
|
9
|
+
- Jupiter: orbital period 11.862615 Earth years
|
10
|
+
- Saturn: orbital period 29.447498 Earth years
|
11
|
+
- Uranus: orbital period 84.016846 Earth years
|
12
|
+
- Neptune: orbital period 164.79132 Earth years
|
13
|
+
|
14
|
+
So if you were told someone were 1,000,000,000 seconds old, you should
|
15
|
+
be able to say that they're 31 Earth-years old.
|
16
|
+
|
17
|
+
If you're wondering why Pluto didn't make the cut, go watch [this
|
18
|
+
youtube video](http://www.youtube.com/watch?v=Z_2gbGXzFbs).
|
19
|
+
|
20
|
+
### Submitting Exercises
|
21
|
+
|
22
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
23
|
+
|
24
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
25
|
+
|
26
|
+
|
27
|
+
For more detailed information about running tests, code style and linting,
|
28
|
+
please see the [help page](http://exercism.io/languages/python).
|
29
|
+
|
30
|
+
## Source
|
31
|
+
|
32
|
+
Partially inspired by Chapter 1 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=01](http://pine.fm/LearnToProgram/?Chapter=01)
|
33
|
+
|
34
|
+
## Submitting Incomplete Solutions
|
35
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# Strain
|
2
|
+
|
3
|
+
Implement the `keep` and `discard` operation on collections. Given a collection
|
4
|
+
and a predicate on the collection's elements, `keep` returns a new collection
|
5
|
+
containing those elements where the predicate is true, while `discard` returns
|
6
|
+
a new collection containing those elements where the predicate is false.
|
7
|
+
|
8
|
+
For example, given the collection of numbers:
|
9
|
+
|
10
|
+
- 1, 2, 3, 4, 5
|
11
|
+
|
12
|
+
And the predicate:
|
13
|
+
|
14
|
+
- is the number even?
|
15
|
+
|
16
|
+
Then your keep operation should produce:
|
17
|
+
|
18
|
+
- 2, 4
|
19
|
+
|
20
|
+
While your discard operation should produce:
|
21
|
+
|
22
|
+
- 1, 3, 5
|
23
|
+
|
24
|
+
Note that the union of keep and discard is all the elements.
|
25
|
+
|
26
|
+
The functions may be called `keep` and `discard`, or they may need different
|
27
|
+
names in order to not clash with existing functions or concepts in your
|
28
|
+
language.
|
29
|
+
|
30
|
+
## Restrictions
|
31
|
+
|
32
|
+
Keep your hands off that filter/reject/whatchamacallit functionality
|
33
|
+
provided by your standard library! Solve this one yourself using other
|
34
|
+
basic tools instead.
|
35
|
+
|
36
|
+
### Submitting Exercises
|
37
|
+
|
38
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
39
|
+
|
40
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
41
|
+
|
42
|
+
|
43
|
+
For more detailed information about running tests, code style and linting,
|
44
|
+
please see the [help page](http://exercism.io/languages/python).
|
45
|
+
|
46
|
+
## Source
|
47
|
+
|
48
|
+
Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2)
|
49
|
+
|
50
|
+
## Submitting Incomplete Solutions
|
51
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Sublist
|
2
|
+
|
3
|
+
Given two lists determine if the first list is contained within the second
|
4
|
+
list, if the second list is contained within the first list, if both lists are
|
5
|
+
contained within each other or if none of these are true.
|
6
|
+
|
7
|
+
Specifically, a list A is a sublist of list B if by dropping 0 or more elements
|
8
|
+
from the front of B and 0 or more elements from the back of B you get a list
|
9
|
+
that's completely equal to A.
|
10
|
+
|
11
|
+
Examples:
|
12
|
+
|
13
|
+
* A = [1, 2, 3], B = [1, 2, 3, 4, 5], A is a sublist of B
|
14
|
+
* A = [3, 4, 5], B = [1, 2, 3, 4, 5], A is a sublist of B
|
15
|
+
* A = [3, 4], B = [1, 2, 3, 4, 5], A is a sublist of B
|
16
|
+
* A = [1, 2, 3], B = [1, 2, 3], A is equal to B
|
17
|
+
* A = [1, 2, 3, 4, 5], B = [2, 3, 4], A is a superlist of B
|
18
|
+
* A = [1, 2, 4], B = [1, 2, 3, 4, 5], A is not a superlist of, sublist of or equal to B
|
19
|
+
|
20
|
+
### Submitting Exercises
|
21
|
+
|
22
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
23
|
+
|
24
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
25
|
+
|
26
|
+
|
27
|
+
For more detailed information about running tests, code style and linting,
|
28
|
+
please see the [help page](http://exercism.io/languages/python).
|
29
|
+
|
30
|
+
|
31
|
+
## Submitting Incomplete Solutions
|
32
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# Sum Of Multiples
|
2
|
+
|
3
|
+
Given a number, find the sum of all the multiples of particular numbers up to
|
4
|
+
but not including that number.
|
5
|
+
|
6
|
+
If we list all the natural numbers up to but not including 20 that are
|
7
|
+
multiples of either 3 or 5, we get 3, 5, 6 and 9, 10, 12, 15, and 18.
|
8
|
+
|
9
|
+
The sum of these multiples is 78.
|
10
|
+
|
11
|
+
Given a number, find the sum of the multiples of a given set of numbers,
|
12
|
+
up to but not including that number.
|
13
|
+
|
14
|
+
### Submitting Exercises
|
15
|
+
|
16
|
+
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
17
|
+
|
18
|
+
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
19
|
+
|
20
|
+
|
21
|
+
For more detailed information about running tests, code style and linting,
|
22
|
+
please see the [help page](http://exercism.io/languages/python).
|
23
|
+
|
24
|
+
## Source
|
25
|
+
|
26
|
+
A variation on Problem 1 at Project Euler [http://projecteuler.net/problem=1](http://projecteuler.net/problem=1)
|
27
|
+
|
28
|
+
## Submitting Incomplete Solutions
|
29
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|