trackler 2.2.0.2 → 2.2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/fixtures/deprecation-fixtures/tracks/repo-nope/config.json +2 -0
- data/fixtures/deprecation-fixtures/tracks/repo-yepp/config.json +3 -0
- data/lib/trackler/track.rb +1 -1
- data/lib/trackler/version.rb +1 -1
- data/tracks/csharp/config/exercise_readme.go.tmpl +16 -0
- data/tracks/csharp/exercises/accumulate/README.md +44 -0
- data/tracks/csharp/exercises/acronym/README.md +21 -0
- data/tracks/csharp/exercises/all-your-base/README.md +41 -0
- data/tracks/csharp/exercises/allergies/README.md +46 -0
- data/tracks/csharp/exercises/alphametics/README.md +48 -0
- data/tracks/csharp/exercises/anagram/README.md +19 -0
- data/tracks/csharp/exercises/atbash-cipher/README.md +40 -0
- data/tracks/csharp/exercises/bank-account/README.md +41 -0
- data/tracks/csharp/exercises/beer-song/README.md +336 -0
- data/tracks/csharp/exercises/binary-search-tree/README.md +66 -0
- data/tracks/csharp/exercises/binary-search/README.md +47 -0
- data/tracks/csharp/exercises/bob/README.md +24 -0
- data/tracks/csharp/exercises/book-store/README.md +80 -0
- data/tracks/csharp/exercises/bowling/README.md +59 -0
- data/tracks/csharp/exercises/bracket-push/README.md +16 -0
- data/tracks/csharp/exercises/change/README.md +29 -0
- data/tracks/csharp/exercises/circular-buffer/README.md +56 -0
- data/tracks/csharp/exercises/clock/README.md +25 -0
- data/tracks/csharp/exercises/connect/README.md +40 -0
- data/tracks/csharp/exercises/crypto-square/README.md +80 -0
- data/tracks/csharp/exercises/custom-set/README.md +23 -0
- data/tracks/csharp/exercises/diamond/README.md +75 -0
- data/tracks/csharp/exercises/difference-of-squares/README.md +30 -0
- data/tracks/csharp/exercises/diffie-hellman/README.md +55 -0
- data/tracks/csharp/exercises/dominoes/README.md +24 -0
- data/tracks/csharp/exercises/dot-dsl/README.md +37 -0
- data/tracks/csharp/exercises/error-handling/README.md +19 -0
- data/tracks/csharp/exercises/etl/README.md +57 -0
- data/tracks/csharp/exercises/flatten-array/README.md +24 -0
- data/tracks/csharp/exercises/food-chain/README.md +80 -0
- data/tracks/csharp/exercises/forth/README.md +39 -0
- data/tracks/csharp/exercises/gigasecond/README.md +17 -0
- data/tracks/csharp/exercises/go-counting/README.md +43 -0
- data/tracks/csharp/exercises/grade-school/README.md +48 -0
- data/tracks/csharp/exercises/grains/README.md +40 -0
- data/tracks/csharp/exercises/grep/README.md +77 -0
- data/tracks/csharp/exercises/hamming/README.md +48 -0
- data/tracks/csharp/exercises/hangman/README.md +32 -0
- data/tracks/csharp/exercises/hello-world/README.md +27 -0
- data/tracks/csharp/exercises/house/README.md +123 -0
- data/tracks/csharp/exercises/isogram/README.md +25 -0
- data/tracks/csharp/exercises/kindergarten-garden/README.md +72 -0
- data/tracks/csharp/exercises/largest-series-product/README.md +26 -0
- data/tracks/csharp/exercises/leap/README.md +39 -0
- data/tracks/csharp/exercises/ledger/README.md +24 -0
- data/tracks/csharp/exercises/linked-list/README.md +40 -0
- data/tracks/csharp/exercises/list-ops/README.md +19 -0
- data/tracks/csharp/exercises/luhn/README.md +77 -0
- data/tracks/csharp/exercises/markdown/README.md +28 -0
- data/tracks/csharp/exercises/matrix/README.md +51 -0
- data/tracks/csharp/exercises/meetup/README.md +36 -0
- data/tracks/csharp/exercises/minesweeper/README.md +36 -0
- data/tracks/csharp/exercises/nth-prime/README.md +29 -0
- data/tracks/csharp/exercises/nucleotide-count/README.md +43 -0
- data/tracks/csharp/exercises/ocr-numbers/README.md +91 -0
- data/tracks/csharp/exercises/palindrome-products/README.md +51 -0
- data/tracks/csharp/exercises/pangram/README.md +21 -0
- data/tracks/csharp/exercises/parallel-letter-frequency/README.md +17 -0
- data/tracks/csharp/exercises/pascals-triangle/README.md +27 -0
- data/tracks/csharp/exercises/perfect-numbers/README.md +30 -0
- data/tracks/csharp/exercises/phone-number/README.md +40 -0
- data/tracks/csharp/exercises/pig-latin/README.md +30 -0
- data/tracks/csharp/exercises/poker/README.md +18 -0
- data/tracks/csharp/exercises/pov/README.md +52 -0
- data/tracks/csharp/exercises/prime-factors/README.md +42 -0
- data/tracks/csharp/exercises/protein-translation/README.md +55 -0
- data/tracks/csharp/exercises/proverb/README.md +28 -0
- data/tracks/csharp/exercises/pythagorean-triplet/README.md +30 -0
- data/tracks/csharp/exercises/queen-attack/README.md +39 -0
- data/tracks/csharp/exercises/rail-fence-cipher/README.md +66 -0
- data/tracks/csharp/exercises/raindrops/README.md +30 -0
- data/tracks/csharp/exercises/react/README.md +29 -0
- data/tracks/csharp/exercises/rectangles/README.md +73 -0
- data/tracks/csharp/exercises/rna-transcription/README.md +31 -0
- data/tracks/csharp/exercises/robot-name/README.md +28 -0
- data/tracks/csharp/exercises/robot-simulator/README.md +40 -0
- data/tracks/csharp/exercises/roman-numerals/README.md +59 -0
- data/tracks/csharp/exercises/rotational-cipher/README.md +42 -0
- data/tracks/csharp/exercises/run-length-encoding/README.md +36 -0
- data/tracks/csharp/exercises/saddle-points/README.md +44 -0
- data/tracks/csharp/exercises/say/README.md +75 -0
- data/tracks/csharp/exercises/scale-generator/README.md +66 -0
- data/tracks/csharp/exercises/scrabble-score/README.md +50 -0
- data/tracks/csharp/exercises/secret-handshake/README.md +41 -0
- data/tracks/csharp/exercises/series/README.md +33 -0
- data/tracks/csharp/exercises/sgf-parsing/README.md +78 -0
- data/tracks/csharp/exercises/sieve/README.md +40 -0
- data/tracks/csharp/exercises/simple-cipher/README.md +96 -0
- data/tracks/csharp/exercises/simple-linked-list/README.md +38 -0
- data/tracks/csharp/exercises/space-age/README.md +30 -0
- data/tracks/csharp/exercises/strain/README.md +46 -0
- data/tracks/csharp/exercises/sublist/README.md +32 -0
- data/tracks/csharp/exercises/sum-of-multiples/README.md +28 -0
- data/tracks/csharp/exercises/tournament/README.md +74 -0
- data/tracks/csharp/exercises/transpose/README.md +71 -0
- data/tracks/csharp/exercises/tree-building/README.md +36 -0
- data/tracks/csharp/exercises/triangle/README.md +32 -0
- data/tracks/csharp/exercises/twelve-days/README.md +45 -0
- data/tracks/csharp/exercises/two-bucket/README.md +42 -0
- data/tracks/csharp/exercises/variable-length-quantity/README.md +50 -0
- data/tracks/csharp/exercises/word-count/README.md +25 -0
- data/tracks/csharp/exercises/word-search/README.md +43 -0
- data/tracks/csharp/exercises/wordy/README.md +73 -0
- data/tracks/csharp/exercises/zebra-puzzle/README.md +43 -0
- data/tracks/csharp/exercises/zipper/README.md +41 -0
- data/tracks/dart/config/exercise_readme.go.tmpl +16 -0
- data/tracks/dart/exercises/bob/README.md +18 -0
- data/tracks/dart/exercises/difference-of-squares/README.md +19 -0
- data/tracks/dart/exercises/gigasecond/README.md +11 -0
- data/tracks/dart/exercises/hamming/README.md +42 -0
- data/tracks/dart/exercises/hello-world/README.md +21 -0
- data/tracks/dart/exercises/leap/README.md +33 -0
- data/tracks/dart/exercises/rna-transcription/README.md +25 -0
- data/tracks/delphi/config.json +25 -32
- data/tracks/elixir/config.json +255 -3
- data/tracks/elixir/config/exercise_readme.go.tmpl +16 -0
- data/tracks/elixir/exercises/accumulate/README.md +72 -0
- data/tracks/elixir/exercises/acronym/README.md +52 -0
- data/tracks/elixir/exercises/all-your-base/README.md +72 -0
- data/tracks/elixir/exercises/allergies/README.md +74 -0
- data/tracks/elixir/exercises/anagram/README.md +50 -0
- data/tracks/elixir/exercises/atbash-cipher/README.md +71 -0
- data/tracks/elixir/exercises/bank-account/README.md +67 -0
- data/tracks/elixir/exercises/beer-song/README.md +364 -0
- data/tracks/elixir/exercises/binary-search/README.md +78 -0
- data/tracks/elixir/exercises/binary/README.md +72 -0
- data/tracks/elixir/exercises/bob/README.md +55 -0
- data/tracks/elixir/exercises/bowling/README.md +90 -0
- data/tracks/elixir/exercises/bowling/bowling_test.exs +91 -18
- data/tracks/elixir/exercises/bowling/example.exs +4 -4
- data/tracks/elixir/exercises/bracket-push/README.md +47 -0
- data/tracks/elixir/exercises/change/README.md +60 -0
- data/tracks/elixir/exercises/clock/README.md +50 -0
- data/tracks/elixir/exercises/collatz-conjecture/README.md +70 -0
- data/tracks/elixir/exercises/connect/README.md +71 -0
- data/tracks/elixir/exercises/crypto-square/README.md +111 -0
- data/tracks/elixir/exercises/custom-set/README.md +48 -0
- data/tracks/elixir/exercises/diamond/README.md +96 -0
- data/tracks/elixir/exercises/difference-of-squares/README.md +56 -0
- data/tracks/elixir/exercises/diffie-hellman/README.md +93 -0
- data/tracks/elixir/exercises/dominoes/README.md +55 -0
- data/tracks/elixir/exercises/dot-dsl/README.md +65 -0
- data/tracks/elixir/exercises/etl/README.md +88 -0
- data/tracks/elixir/exercises/flatten-array/README.md +55 -0
- data/tracks/elixir/exercises/forth/README.md +66 -0
- data/tracks/elixir/exercises/gigasecond/README.md +48 -0
- data/tracks/elixir/exercises/grade-school/README.md +79 -0
- data/tracks/elixir/exercises/grains/README.md +71 -0
- data/tracks/elixir/exercises/grep/README.md +108 -0
- data/tracks/elixir/exercises/hamming/README.md +79 -0
- data/tracks/elixir/exercises/hello-world/README.md +58 -0
- data/tracks/elixir/exercises/hexadecimal/README.md +51 -0
- data/tracks/elixir/exercises/isogram/README.md +56 -0
- data/tracks/elixir/exercises/kindergarten-garden/README.md +103 -0
- data/tracks/elixir/exercises/largest-series-product/README.md +57 -0
- data/tracks/elixir/exercises/leap/README.md +70 -0
- data/tracks/elixir/exercises/list-ops/README.md +47 -0
- data/tracks/elixir/exercises/luhn/README.md +108 -0
- data/tracks/elixir/exercises/markdown/README.md +55 -0
- data/tracks/elixir/exercises/matrix/README.md +82 -0
- data/tracks/elixir/exercises/meetup/README.md +67 -0
- data/tracks/elixir/exercises/minesweeper/README.md +67 -0
- data/tracks/elixir/exercises/nth-prime/README.md +52 -0
- data/tracks/elixir/exercises/nucleotide-count/README.md +70 -0
- data/tracks/elixir/exercises/ocr-numbers/README.md +122 -0
- data/tracks/elixir/exercises/palindrome-products/README.md +77 -0
- data/tracks/elixir/exercises/pangram/README.md +52 -0
- data/tracks/elixir/exercises/parallel-letter-frequency/README.md +48 -0
- data/tracks/elixir/exercises/pascals-triangle/README.md +58 -0
- data/tracks/elixir/exercises/perfect-numbers/README.md +61 -0
- data/tracks/elixir/exercises/phone-number/README.md +71 -0
- data/tracks/elixir/exercises/pig-latin/README.md +61 -0
- data/tracks/elixir/exercises/poker/README.md +49 -0
- data/tracks/elixir/exercises/prime-factors/README.md +73 -0
- data/tracks/elixir/exercises/protein-translation/README.md +86 -0
- data/tracks/elixir/exercises/pythagorean-triplet/README.md +61 -0
- data/tracks/elixir/exercises/queen-attack/README.md +70 -0
- data/tracks/elixir/exercises/rail-fence-cipher/README.md +97 -0
- data/tracks/elixir/exercises/raindrops/README.md +61 -0
- data/tracks/elixir/exercises/rna-transcription/README.md +62 -0
- data/tracks/elixir/exercises/robot-simulator/README.md +71 -0
- data/tracks/elixir/exercises/roman-numerals/README.md +86 -0
- data/tracks/elixir/exercises/rotational-cipher/README.md +73 -0
- data/tracks/elixir/exercises/run-length-encoding/README.md +67 -0
- data/tracks/elixir/exercises/saddle-points/README.md +70 -0
- data/tracks/elixir/exercises/say/README.md +106 -0
- data/tracks/elixir/exercises/scale-generator/README.md +97 -0
- data/tracks/elixir/exercises/scrabble-score/README.md +81 -0
- data/tracks/elixir/exercises/secret-handshake/README.md +94 -0
- data/tracks/elixir/exercises/series/README.md +64 -0
- data/tracks/elixir/exercises/sieve/README.md +71 -0
- data/tracks/elixir/exercises/simple-cipher/README.md +127 -0
- data/tracks/elixir/exercises/simple-linked-list/README.md +65 -0
- data/tracks/elixir/exercises/space-age/README.md +61 -0
- data/tracks/elixir/exercises/strain/README.md +80 -0
- data/tracks/elixir/exercises/sublist/README.md +58 -0
- data/tracks/elixir/exercises/sum-of-multiples/README.md +55 -0
- data/tracks/elixir/exercises/tournament/README.md +110 -0
- data/tracks/elixir/exercises/triangle/README.md +63 -0
- data/tracks/elixir/exercises/twelve-days/README.md +72 -0
- data/tracks/elixir/exercises/word-count/README.md +56 -0
- data/tracks/elixir/exercises/wordy/README.md +100 -0
- data/tracks/elixir/exercises/zipper/README.md +68 -0
- data/tracks/fsharp/config/exercise_readme.go.tmpl +16 -0
- data/tracks/fsharp/exercises/accumulate/README.md +40 -0
- data/tracks/fsharp/exercises/acronym/README.md +15 -0
- data/tracks/fsharp/exercises/all-your-base/README.md +35 -0
- data/tracks/fsharp/exercises/allergies/README.md +37 -0
- data/tracks/fsharp/exercises/alphametics/README.md +41 -0
- data/tracks/fsharp/exercises/anagram/README.md +13 -0
- data/tracks/fsharp/exercises/atbash-cipher/README.md +34 -0
- data/tracks/fsharp/exercises/bank-account/README.md +30 -0
- data/tracks/fsharp/exercises/beer-song/README.md +331 -0
- data/tracks/fsharp/exercises/binary-search-tree/README.md +60 -0
- data/tracks/fsharp/exercises/binary-search/README.md +41 -0
- data/tracks/fsharp/exercises/bob/README.md +18 -0
- data/tracks/fsharp/exercises/book-store/README.md +74 -0
- data/tracks/fsharp/exercises/bowling/README.md +53 -0
- data/tracks/fsharp/exercises/bracket-push/README.md +10 -0
- data/tracks/fsharp/exercises/change/README.md +23 -0
- data/tracks/fsharp/exercises/circular-buffer/README.md +50 -0
- data/tracks/fsharp/exercises/clock/README.md +13 -0
- data/tracks/fsharp/exercises/connect/README.md +34 -0
- data/tracks/fsharp/exercises/crypto-square/README.md +74 -0
- data/tracks/fsharp/exercises/custom-set/README.md +11 -0
- data/tracks/fsharp/exercises/diamond/README.md +62 -0
- data/tracks/fsharp/exercises/difference-of-squares/README.md +25 -0
- data/tracks/fsharp/exercises/diffie-hellman/README.md +49 -0
- data/tracks/fsharp/exercises/dominoes/README.md +18 -0
- data/tracks/fsharp/exercises/dot-dsl/README.md +28 -0
- data/tracks/fsharp/exercises/error-handling/README.md +13 -0
- data/tracks/fsharp/exercises/etl/README.md +51 -0
- data/tracks/fsharp/exercises/food-chain/README.md +74 -0
- data/tracks/fsharp/exercises/forth/README.md +29 -0
- data/tracks/fsharp/exercises/gigasecond/README.md +15 -0
- data/tracks/fsharp/exercises/go-counting/README.md +37 -0
- data/tracks/fsharp/exercises/grade-school/README.md +47 -0
- data/tracks/fsharp/exercises/grains/README.md +39 -0
- data/tracks/fsharp/exercises/grep/README.md +71 -0
- data/tracks/fsharp/exercises/hamming/README.md +42 -0
- data/tracks/fsharp/exercises/hangman/README.md +21 -0
- data/tracks/fsharp/exercises/hello-world/README.md +21 -0
- data/tracks/fsharp/exercises/house/README.md +117 -0
- data/tracks/fsharp/exercises/isogram/README.md +19 -0
- data/tracks/fsharp/exercises/kindergarten-garden/README.md +66 -0
- data/tracks/fsharp/exercises/largest-series-product/README.md +20 -0
- data/tracks/fsharp/exercises/leap/README.md +33 -0
- data/tracks/fsharp/exercises/ledger/README.md +18 -0
- data/tracks/fsharp/exercises/lens-person/README.md +15 -0
- data/tracks/fsharp/exercises/linked-list/README.md +50 -0
- data/tracks/fsharp/exercises/list-ops/README.md +10 -0
- data/tracks/fsharp/exercises/luhn/README.md +71 -0
- data/tracks/fsharp/exercises/markdown/README.md +18 -0
- data/tracks/fsharp/exercises/matrix/README.md +45 -0
- data/tracks/fsharp/exercises/meetup/README.md +30 -0
- data/tracks/fsharp/exercises/minesweeper/README.md +30 -0
- data/tracks/fsharp/exercises/nth-prime/README.md +21 -0
- data/tracks/fsharp/exercises/nucleotide-count/README.md +33 -0
- data/tracks/fsharp/exercises/ocr-numbers/README.md +85 -0
- data/tracks/fsharp/exercises/palindrome-products/README.md +44 -0
- data/tracks/fsharp/exercises/pangram/README.md +15 -0
- data/tracks/fsharp/exercises/parallel-letter-frequency/README.md +15 -0
- data/tracks/fsharp/exercises/pascals-triangle/README.md +21 -0
- data/tracks/fsharp/exercises/perfect-numbers/README.md +24 -0
- data/tracks/fsharp/exercises/phone-number/README.md +34 -0
- data/tracks/fsharp/exercises/pig-latin/README.md +24 -0
- data/tracks/fsharp/exercises/poker/README.md +15 -0
- data/tracks/fsharp/exercises/pov/README.md +46 -0
- data/tracks/fsharp/exercises/prime-factors/README.md +36 -0
- data/tracks/fsharp/exercises/protein-translation/README.md +49 -0
- data/tracks/fsharp/exercises/proverb/README.md +22 -0
- data/tracks/fsharp/exercises/pythagorean-triplet/README.md +24 -0
- data/tracks/fsharp/exercises/queen-attack/README.md +33 -0
- data/tracks/fsharp/exercises/rail-fence-cipher/README.md +60 -0
- data/tracks/fsharp/exercises/raindrops/README.md +27 -0
- data/tracks/fsharp/exercises/react/README.md +19 -0
- data/tracks/fsharp/exercises/rectangles/README.md +67 -0
- data/tracks/fsharp/exercises/rna-transcription/README.md +29 -0
- data/tracks/fsharp/exercises/robot-name/README.md +22 -0
- data/tracks/fsharp/exercises/robot-simulator/README.md +34 -0
- data/tracks/fsharp/exercises/roman-numerals/README.md +49 -0
- data/tracks/fsharp/exercises/run-length-encoding/README.md +30 -0
- data/tracks/fsharp/exercises/saddle-points/README.md +33 -0
- data/tracks/fsharp/exercises/say/README.md +69 -0
- data/tracks/fsharp/exercises/scale-generator/README.md +60 -0
- data/tracks/fsharp/exercises/scrabble-score/README.md +44 -0
- data/tracks/fsharp/exercises/secret-handshake/README.md +35 -0
- data/tracks/fsharp/exercises/series/README.md +27 -0
- data/tracks/fsharp/exercises/sgf-parsing/README.md +68 -0
- data/tracks/fsharp/exercises/sieve/README.md +34 -0
- data/tracks/fsharp/exercises/simple-cipher/README.md +90 -0
- data/tracks/fsharp/exercises/simple-linked-list/README.md +28 -0
- data/tracks/fsharp/exercises/space-age/README.md +28 -0
- data/tracks/fsharp/exercises/strain/README.md +40 -0
- data/tracks/fsharp/exercises/sublist/README.md +21 -0
- data/tracks/fsharp/exercises/sum-of-multiples/README.md +18 -0
- data/tracks/fsharp/exercises/tournament/README.md +68 -0
- data/tracks/fsharp/exercises/transpose/README.md +65 -0
- data/tracks/fsharp/exercises/tree-building/README.md +30 -0
- data/tracks/fsharp/exercises/triangle/README.md +26 -0
- data/tracks/fsharp/exercises/twelve-days/README.md +39 -0
- data/tracks/fsharp/exercises/two-bucket/README.md +36 -0
- data/tracks/fsharp/exercises/variable-length-quantity/README.md +39 -0
- data/tracks/fsharp/exercises/word-count/README.md +19 -0
- data/tracks/fsharp/exercises/word-search/README.md +30 -0
- data/tracks/fsharp/exercises/wordy/README.md +68 -0
- data/tracks/fsharp/exercises/zebra-puzzle/README.md +32 -0
- data/tracks/fsharp/exercises/zipper/README.md +31 -0
- data/tracks/haskell/README.md +2 -2
- data/tracks/javascript/config.json +232 -4
- data/tracks/kotlin/config.json +8 -1
- data/tracks/kotlin/exercises/rotational-cipher/build.gradle +28 -0
- data/tracks/kotlin/exercises/rotational-cipher/src/example/kotlin/RotationalCipher.kt +18 -0
- data/tracks/kotlin/exercises/rotational-cipher/src/main/kotlin/.keep +0 -0
- data/tracks/kotlin/exercises/rotational-cipher/src/test/kotlin/RotationalCipherTest.kt +81 -0
- data/tracks/kotlin/exercises/settings.gradle +1 -0
- data/tracks/powershell/config/exercise_readme.go.tmpl +16 -0
- data/tracks/powershell/exercises/hamming/README.md +42 -0
- data/tracks/powershell/exercises/hello-world/README.md +21 -0
- data/tracks/purescript/README.md +4 -4
- data/tracks/scala/config.json +266 -6
- data/tracks/scala/config/exercise_readme.go.tmpl +16 -0
- data/tracks/scala/exercises/accumulate/README.md +46 -0
- data/tracks/scala/exercises/acronym/README.md +26 -0
- data/tracks/scala/exercises/all-your-base/README.md +46 -0
- data/tracks/scala/exercises/allergies/README.md +48 -0
- data/tracks/scala/exercises/alphametics/README.md +46 -0
- data/tracks/scala/exercises/anagram/README.md +24 -0
- data/tracks/scala/exercises/atbash-cipher/README.md +45 -0
- data/tracks/scala/exercises/bank-account/README.md +54 -0
- data/tracks/scala/exercises/beer-song/README.md +338 -0
- data/tracks/scala/exercises/binary-search-tree/README.md +71 -0
- data/tracks/scala/exercises/binary-search/README.md +52 -0
- data/tracks/scala/exercises/binary/README.md +46 -0
- data/tracks/scala/exercises/bob/README.md +29 -0
- data/tracks/scala/exercises/book-store/README.md +85 -0
- data/tracks/scala/exercises/bowling/README.md +64 -0
- data/tracks/scala/exercises/bracket-push/README.md +21 -0
- data/tracks/scala/exercises/change/README.md +34 -0
- data/tracks/scala/exercises/clock/README.md +24 -0
- data/tracks/scala/exercises/connect/README.md +53 -0
- data/tracks/scala/exercises/crypto-square/README.md +85 -0
- data/tracks/scala/exercises/custom-set/README.md +22 -0
- data/tracks/scala/exercises/difference-of-squares/README.md +30 -0
- data/tracks/scala/exercises/dominoes/README.md +29 -0
- data/tracks/scala/exercises/etl/README.md +62 -0
- data/tracks/scala/exercises/food-chain/README.md +81 -0
- data/tracks/scala/exercises/forth/README.md +40 -0
- data/tracks/scala/exercises/gigasecond/README.md +26 -0
- data/tracks/scala/exercises/grade-school/README.md +53 -0
- data/tracks/scala/exercises/grains/README.md +45 -0
- data/tracks/scala/exercises/hamming/README.md +112 -0
- data/tracks/scala/exercises/hello-world/README.md +38 -0
- data/tracks/scala/exercises/hexadecimal/README.md +25 -0
- data/tracks/scala/exercises/house/README.md +124 -0
- data/tracks/scala/exercises/isogram/README.md +30 -0
- data/tracks/scala/exercises/kindergarten-garden/README.md +77 -0
- data/tracks/scala/exercises/largest-series-product/README.md +31 -0
- data/tracks/scala/exercises/leap/README.md +50 -0
- data/tracks/scala/exercises/lens-person/README.md +11 -7
- data/tracks/scala/exercises/linked-list/README.md +45 -0
- data/tracks/scala/exercises/luhn/README.md +82 -0
- data/tracks/scala/exercises/matrix/README.md +56 -0
- data/tracks/scala/exercises/meetup/README.md +41 -0
- data/tracks/scala/exercises/minesweeper/README.md +41 -0
- data/tracks/scala/exercises/nth-prime/README.md +26 -0
- data/tracks/scala/exercises/nucleotide-count/README.md +107 -0
- data/tracks/scala/exercises/ocr-numbers/README.md +96 -0
- data/tracks/scala/exercises/octal/README.md +60 -0
- data/tracks/scala/exercises/palindrome-products/README.md +51 -0
- data/tracks/scala/exercises/pangram/README.md +26 -0
- data/tracks/scala/exercises/parallel-letter-frequency/README.md +50 -0
- data/tracks/scala/exercises/pascals-triangle/README.md +32 -0
- data/tracks/scala/exercises/perfect-numbers/README.md +35 -0
- data/tracks/scala/exercises/phone-number/README.md +56 -0
- data/tracks/scala/exercises/pig-latin/README.md +35 -0
- data/tracks/scala/exercises/prime-factors/README.md +47 -0
- data/tracks/scala/exercises/protein-translation/README.md +60 -0
- data/tracks/scala/exercises/pythagorean-triplet/README.md +35 -0
- data/tracks/scala/exercises/queen-attack/README.md +44 -0
- data/tracks/scala/exercises/rail-fence-cipher/README.md +71 -0
- data/tracks/scala/exercises/raindrops/README.md +35 -0
- data/tracks/scala/exercises/rna-transcription/README.md +36 -0
- data/tracks/scala/exercises/robot-name/README.md +40 -0
- data/tracks/scala/exercises/robot-simulator/README.md +45 -0
- data/tracks/scala/exercises/roman-numerals/README.md +72 -0
- data/tracks/scala/exercises/run-length-encoding/README.md +41 -0
- data/tracks/scala/exercises/saddle-points/README.md +44 -0
- data/tracks/scala/exercises/say/README.md +80 -0
- data/tracks/scala/exercises/scrabble-score/README.md +55 -0
- data/tracks/scala/exercises/secret-handshake/README.md +46 -0
- data/tracks/scala/exercises/series/README.md +38 -0
- data/tracks/scala/exercises/sgf-parsing/README.md +79 -0
- data/tracks/scala/exercises/sieve/README.md +45 -0
- data/tracks/scala/exercises/simple-cipher/README.md +101 -0
- data/tracks/scala/exercises/simple-linked-list/README.md +39 -0
- data/tracks/scala/exercises/space-age/README.md +35 -0
- data/tracks/scala/exercises/spiral-matrix/README.md +41 -0
- data/tracks/scala/exercises/strain/README.md +51 -0
- data/tracks/scala/exercises/sublist/README.md +32 -0
- data/tracks/scala/exercises/sum-of-multiples/README.md +29 -0
- data/tracks/scala/exercises/triangle/README.md +37 -0
- data/tracks/scala/exercises/trinary/README.md +39 -0
- data/tracks/scala/exercises/variable-length-quantity/README.md +54 -0
- data/tracks/scala/exercises/word-count/README.md +30 -0
- data/tracks/scala/exercises/wordy/README.md +74 -0
- data/tracks/scala/exercises/zebra-puzzle/README.md +43 -0
- data/tracks/scala/exercises/zipper/README.md +42 -0
- metadata +401 -1
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
## Running tests
|
|
60
|
+
|
|
61
|
+
Execute the tests with:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
$ elixir bob_test.exs
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
(Replace `bob_test.exs` with the name of the test file.)
|
|
68
|
+
|
|
69
|
+
### Pending tests
|
|
70
|
+
|
|
71
|
+
In the test suites, all but the first test have been skipped.
|
|
72
|
+
|
|
73
|
+
Once you get a test passing, you can unskip the next one by
|
|
74
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
|
75
|
+
|
|
76
|
+
For example:
|
|
77
|
+
|
|
78
|
+
```elixir
|
|
79
|
+
# @tag :pending
|
|
80
|
+
test "shouting" do
|
|
81
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
|
82
|
+
end
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Or, you can enable all the tests by commenting out the
|
|
86
|
+
`ExUnit.configure` line in the test suite.
|
|
87
|
+
|
|
88
|
+
```elixir
|
|
89
|
+
# ExUnit.configure exclude: :pending, trace: true
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For more detailed information about the Elixir track, please
|
|
93
|
+
see the [help page](http://exercism.io/languages/elixir).
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
## Submitting Incomplete Solutions
|
|
97
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
## Running tests
|
|
41
|
+
|
|
42
|
+
Execute the tests with:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
$ elixir bob_test.exs
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
(Replace `bob_test.exs` with the name of the test file.)
|
|
49
|
+
|
|
50
|
+
### Pending tests
|
|
51
|
+
|
|
52
|
+
In the test suites, all but the first test have been skipped.
|
|
53
|
+
|
|
54
|
+
Once you get a test passing, you can unskip the next one by
|
|
55
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
|
56
|
+
|
|
57
|
+
For example:
|
|
58
|
+
|
|
59
|
+
```elixir
|
|
60
|
+
# @tag :pending
|
|
61
|
+
test "shouting" do
|
|
62
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
|
63
|
+
end
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or, you can enable all the tests by commenting out the
|
|
67
|
+
`ExUnit.configure` line in the test suite.
|
|
68
|
+
|
|
69
|
+
```elixir
|
|
70
|
+
# ExUnit.configure exclude: :pending, trace: true
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
For more detailed information about the Elixir track, please
|
|
74
|
+
see the [help page](http://exercism.io/languages/elixir).
|
|
75
|
+
|
|
76
|
+
## Source
|
|
77
|
+
|
|
78
|
+
Inspired by the Extreme Startup game [https://github.com/rchatley/extreme_startup](https://github.com/rchatley/extreme_startup)
|
|
79
|
+
|
|
80
|
+
## Submitting Incomplete Solutions
|
|
81
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
use Bitwise (or div/rem)
|
|
32
|
+
|
|
33
|
+
If you use Bitwise, an easy way to see if a particular bit is set is to compare
|
|
34
|
+
the binary AND (`&&&`) of a set of bits with the particular bit pattern you
|
|
35
|
+
want to check, and determine if the result is the same as the pattern you're
|
|
36
|
+
checking.
|
|
37
|
+
|
|
38
|
+
Example:
|
|
39
|
+
|
|
40
|
+
Flags: 0b11011
|
|
41
|
+
Check: 0b11010
|
|
42
|
+
|
|
43
|
+
Flags &&& Check: 0b11010 (All checked bits are set)
|
|
44
|
+
|
|
45
|
+
Another:
|
|
46
|
+
|
|
47
|
+
Flags: 0b11011
|
|
48
|
+
Check: 0b10110
|
|
49
|
+
|
|
50
|
+
Flags &&& Check: 0b10010 (Third bit not set)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
## Running tests
|
|
54
|
+
|
|
55
|
+
Execute the tests with:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
$ elixir bob_test.exs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
(Replace `bob_test.exs` with the name of the test file.)
|
|
62
|
+
|
|
63
|
+
### Pending tests
|
|
64
|
+
|
|
65
|
+
In the test suites, all but the first test have been skipped.
|
|
66
|
+
|
|
67
|
+
Once you get a test passing, you can unskip the next one by
|
|
68
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
|
69
|
+
|
|
70
|
+
For example:
|
|
71
|
+
|
|
72
|
+
```elixir
|
|
73
|
+
# @tag :pending
|
|
74
|
+
test "shouting" do
|
|
75
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
|
76
|
+
end
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Or, you can enable all the tests by commenting out the
|
|
80
|
+
`ExUnit.configure` line in the test suite.
|
|
81
|
+
|
|
82
|
+
```elixir
|
|
83
|
+
# ExUnit.configure exclude: :pending, trace: true
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
For more detailed information about the Elixir track, please
|
|
87
|
+
see the [help page](http://exercism.io/languages/elixir).
|
|
88
|
+
|
|
89
|
+
## Source
|
|
90
|
+
|
|
91
|
+
Bert, in Mary Poppins [http://www.imdb.com/character/ch0011238/quotes](http://www.imdb.com/character/ch0011238/quotes)
|
|
92
|
+
|
|
93
|
+
## Submitting Incomplete Solutions
|
|
94
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,64 @@
|
|
|
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
|
+
## Running tests
|
|
24
|
+
|
|
25
|
+
Execute the tests with:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
$ elixir bob_test.exs
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
(Replace `bob_test.exs` with the name of the test file.)
|
|
32
|
+
|
|
33
|
+
### Pending tests
|
|
34
|
+
|
|
35
|
+
In the test suites, all but the first test have been skipped.
|
|
36
|
+
|
|
37
|
+
Once you get a test passing, you can unskip the next one by
|
|
38
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
|
39
|
+
|
|
40
|
+
For example:
|
|
41
|
+
|
|
42
|
+
```elixir
|
|
43
|
+
# @tag :pending
|
|
44
|
+
test "shouting" do
|
|
45
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
|
46
|
+
end
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or, you can enable all the tests by commenting out the
|
|
50
|
+
`ExUnit.configure` line in the test suite.
|
|
51
|
+
|
|
52
|
+
```elixir
|
|
53
|
+
# ExUnit.configure exclude: :pending, trace: true
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For more detailed information about the Elixir track, please
|
|
57
|
+
see the [help page](http://exercism.io/languages/elixir).
|
|
58
|
+
|
|
59
|
+
## Source
|
|
60
|
+
|
|
61
|
+
A subset of the Problem 8 at Project Euler [http://projecteuler.net/problem=8](http://projecteuler.net/problem=8)
|
|
62
|
+
|
|
63
|
+
## Submitting Incomplete Solutions
|
|
64
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
## Running tests
|
|
31
|
+
|
|
32
|
+
Execute the tests with:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
$ elixir bob_test.exs
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
(Replace `bob_test.exs` with the name of the test file.)
|
|
39
|
+
|
|
40
|
+
### Pending tests
|
|
41
|
+
|
|
42
|
+
In the test suites, all but the first test have been skipped.
|
|
43
|
+
|
|
44
|
+
Once you get a test passing, you can unskip the next one by
|
|
45
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
|
46
|
+
|
|
47
|
+
For example:
|
|
48
|
+
|
|
49
|
+
```elixir
|
|
50
|
+
# @tag :pending
|
|
51
|
+
test "shouting" do
|
|
52
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
|
53
|
+
end
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or, you can enable all the tests by commenting out the
|
|
57
|
+
`ExUnit.configure` line in the test suite.
|
|
58
|
+
|
|
59
|
+
```elixir
|
|
60
|
+
# ExUnit.configure exclude: :pending, trace: true
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For more detailed information about the Elixir track, please
|
|
64
|
+
see the [help page](http://exercism.io/languages/elixir).
|
|
65
|
+
|
|
66
|
+
## Source
|
|
67
|
+
|
|
68
|
+
Sieve of Eratosthenes at Wikipedia [http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes](http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes)
|
|
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,127 @@
|
|
|
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
|
+
## Running tests
|
|
87
|
+
|
|
88
|
+
Execute the tests with:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
$ elixir bob_test.exs
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
(Replace `bob_test.exs` with the name of the test file.)
|
|
95
|
+
|
|
96
|
+
### Pending tests
|
|
97
|
+
|
|
98
|
+
In the test suites, all but the first test have been skipped.
|
|
99
|
+
|
|
100
|
+
Once you get a test passing, you can unskip the next one by
|
|
101
|
+
commenting out the relevant `@tag :pending` with a `#` symbol.
|
|
102
|
+
|
|
103
|
+
For example:
|
|
104
|
+
|
|
105
|
+
```elixir
|
|
106
|
+
# @tag :pending
|
|
107
|
+
test "shouting" do
|
|
108
|
+
assert Bob.hey("WATCH OUT!") == "Whoa, chill out!"
|
|
109
|
+
end
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Or, you can enable all the tests by commenting out the
|
|
113
|
+
`ExUnit.configure` line in the test suite.
|
|
114
|
+
|
|
115
|
+
```elixir
|
|
116
|
+
# ExUnit.configure exclude: :pending, trace: true
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
For more detailed information about the Elixir track, please
|
|
120
|
+
see the [help page](http://exercism.io/languages/elixir).
|
|
121
|
+
|
|
122
|
+
## Source
|
|
123
|
+
|
|
124
|
+
Substitution Cipher at Wikipedia [http://en.wikipedia.org/wiki/Substitution_cipher](http://en.wikipedia.org/wiki/Substitution_cipher)
|
|
125
|
+
|
|
126
|
+
## Submitting Incomplete Solutions
|
|
127
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|