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,33 @@
|
|
1
|
+
# Leap
|
2
|
+
|
3
|
+
Given a year, report if it is a leap year.
|
4
|
+
|
5
|
+
The tricky thing here is that a leap year in the Gregorian calendar occurs:
|
6
|
+
|
7
|
+
```plain
|
8
|
+
on every year that is evenly divisible by 4
|
9
|
+
except every year that is evenly divisible by 100
|
10
|
+
unless the year is also evenly divisible by 400
|
11
|
+
```
|
12
|
+
|
13
|
+
For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap
|
14
|
+
year, but 2000 is.
|
15
|
+
|
16
|
+
If your language provides a method in the standard library that does
|
17
|
+
this look-up, pretend it doesn't exist and implement it yourself.
|
18
|
+
|
19
|
+
## Notes
|
20
|
+
|
21
|
+
Though our exercise adopts some very simple rules, there is more to
|
22
|
+
learn!
|
23
|
+
|
24
|
+
For a delightful, four minute explanation of the whole leap year
|
25
|
+
phenomenon, go watch [this youtube video][video].
|
26
|
+
|
27
|
+
[video]: http://www.youtube.com/watch?v=xX96xng7sAE
|
28
|
+
## Source
|
29
|
+
|
30
|
+
JavaRanch Cattle Drive, exercise 3 [http://www.javaranch.com/leap.jsp](http://www.javaranch.com/leap.jsp)
|
31
|
+
|
32
|
+
## Submitting Incomplete Solutions
|
33
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,71 @@
|
|
1
|
+
# Luhn
|
2
|
+
|
3
|
+
Given a number determine whether or not it is valid per the Luhn formula.
|
4
|
+
|
5
|
+
The [Luhn algorithm](https://en.wikipedia.org/wiki/Luhn_algorithm) is
|
6
|
+
a simple checksum formula used to validate a variety of identification
|
7
|
+
numbers, such as credit card numbers and Canadian Social Insurance
|
8
|
+
Numbers.
|
9
|
+
|
10
|
+
The task is to check if a given string is valid.
|
11
|
+
|
12
|
+
Validating a Number
|
13
|
+
------
|
14
|
+
|
15
|
+
Strings of length 1 or less are not valid. Spaces are allowed in the input,
|
16
|
+
but they should be stripped before checking. All other non-digit characters
|
17
|
+
are disallowed.
|
18
|
+
|
19
|
+
## Example 1: valid credit card number
|
20
|
+
|
21
|
+
```
|
22
|
+
4539 1488 0343 6467
|
23
|
+
```
|
24
|
+
|
25
|
+
The first step of the Luhn algorithm is to double every second digit,
|
26
|
+
starting from the right. We will be doubling
|
27
|
+
|
28
|
+
```
|
29
|
+
4_3_ 1_8_ 0_4_ 6_6_
|
30
|
+
```
|
31
|
+
|
32
|
+
If doubling the number results in a number greater than 9 then subtract 9
|
33
|
+
from the product. The results of our doubling:
|
34
|
+
|
35
|
+
```
|
36
|
+
8569 2478 0383 3437
|
37
|
+
```
|
38
|
+
|
39
|
+
Then sum all of the digits:
|
40
|
+
|
41
|
+
```
|
42
|
+
8+5+6+9+2+4+7+8+0+3+8+3+3+4+3+7 = 80
|
43
|
+
```
|
44
|
+
|
45
|
+
If the sum is evenly divisible by 10, then the number is valid. This number is valid!
|
46
|
+
|
47
|
+
## Example 2: invalid credit card number
|
48
|
+
|
49
|
+
```
|
50
|
+
8273 1232 7352 0569
|
51
|
+
```
|
52
|
+
|
53
|
+
Double the second digits, starting from the right
|
54
|
+
|
55
|
+
```
|
56
|
+
7253 2262 5312 0539
|
57
|
+
```
|
58
|
+
|
59
|
+
Sum the digits
|
60
|
+
|
61
|
+
```
|
62
|
+
7+2+5+3+2+2+6+2+5+3+1+2+0+5+3+9 = 57
|
63
|
+
```
|
64
|
+
|
65
|
+
57 is not evenly divisible by 10, so this number is not valid.
|
66
|
+
## Source
|
67
|
+
|
68
|
+
The Luhn Algorithm on Wikipedia [http://en.wikipedia.org/wiki/Luhn_algorithm](http://en.wikipedia.org/wiki/Luhn_algorithm)
|
69
|
+
|
70
|
+
## Submitting Incomplete Solutions
|
71
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Meetup
|
2
|
+
|
3
|
+
Calculate the date of meetups.
|
4
|
+
|
5
|
+
Typically meetups happen on the same day of the week. In this exercise, you will take
|
6
|
+
a description of a meetup date, and return the actual meetup date.
|
7
|
+
|
8
|
+
Examples of general descriptions are:
|
9
|
+
|
10
|
+
- the first Monday of January 2017
|
11
|
+
- the third Tuesday of January 2017
|
12
|
+
- the Wednesteenth of January 2017
|
13
|
+
- the last Thursday of January 2017
|
14
|
+
|
15
|
+
Note that "Monteenth", "Tuesteenth", etc are all made up words. There
|
16
|
+
was a meetup whose members realized that there are exactly 7 numbered days in a month that
|
17
|
+
end in '-teenth'. Therefore, one is guaranteed that each day of the week
|
18
|
+
(Monday, Tuesday, ...) will have exactly one date that is named with '-teenth'
|
19
|
+
in every month.
|
20
|
+
|
21
|
+
Given examples of a meetup dates, each containing a month, day, year, and descriptor
|
22
|
+
(first, second, teenth, etc), calculate the date of the actual meetup.
|
23
|
+
For example, if given "First Monday of January 2017", the correct meetup date is 2017/1/2
|
24
|
+
|
25
|
+
## Source
|
26
|
+
|
27
|
+
Jeremy Hinegardner mentioned a Boulder meetup that happens on the Wednesteenth of every month [https://twitter.com/copiousfreetime](https://twitter.com/copiousfreetime)
|
28
|
+
|
29
|
+
## Submitting Incomplete Solutions
|
30
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# Minesweeper
|
2
|
+
|
3
|
+
Add the numbers to a minesweeper board.
|
4
|
+
|
5
|
+
Minesweeper is a popular game where the user has to find the mines using
|
6
|
+
numeric hints that indicate how many mines are directly adjacent
|
7
|
+
(horizontally, vertically, diagonally) to a square.
|
8
|
+
|
9
|
+
In this exercise you have to create some code that counts the number of
|
10
|
+
mines adjacent to a square and transforms boards like this (where `*`
|
11
|
+
indicates a mine):
|
12
|
+
|
13
|
+
+-----+
|
14
|
+
| * * |
|
15
|
+
| * |
|
16
|
+
| * |
|
17
|
+
| |
|
18
|
+
+-----+
|
19
|
+
|
20
|
+
into this:
|
21
|
+
|
22
|
+
+-----+
|
23
|
+
|1*3*1|
|
24
|
+
|13*31|
|
25
|
+
| 2*2 |
|
26
|
+
| 111 |
|
27
|
+
+-----+
|
28
|
+
|
29
|
+
## Submitting Incomplete Solutions
|
30
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Nth Prime
|
2
|
+
|
3
|
+
Given a number n, determine what the nth prime is.
|
4
|
+
|
5
|
+
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
|
6
|
+
the 6th prime is 13.
|
7
|
+
|
8
|
+
If your language provides methods in the standard library to deal with prime
|
9
|
+
numbers, pretend they don't exist and implement them yourself.
|
10
|
+
## Source
|
11
|
+
|
12
|
+
A variation on Problem 7 at Project Euler [http://projecteuler.net/problem=7](http://projecteuler.net/problem=7)
|
13
|
+
|
14
|
+
## Submitting Incomplete Solutions
|
15
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Nucleotide Count
|
2
|
+
|
3
|
+
Given a DNA string, compute how many times each nucleotide occurs in the string.
|
4
|
+
|
5
|
+
DNA is represented by an alphabet of the following symbols: 'A', 'C',
|
6
|
+
'G', and 'T'.
|
7
|
+
|
8
|
+
Each symbol represents a nucleotide, which is a fancy name for the
|
9
|
+
particular molecules that happen to make up a large part of DNA.
|
10
|
+
|
11
|
+
Shortest intro to biochemistry EVAR:
|
12
|
+
|
13
|
+
- twigs are to birds nests as
|
14
|
+
- nucleotides are to DNA and RNA as
|
15
|
+
- amino acids are to proteins as
|
16
|
+
- sugar is to starch as
|
17
|
+
- oh crap lipids
|
18
|
+
|
19
|
+
I'm not going to talk about lipids because they're crazy complex.
|
20
|
+
|
21
|
+
So back to nucleotides.
|
22
|
+
|
23
|
+
DNA contains four types of them: adenine (`A`), cytosine (`C`), guanine
|
24
|
+
(`G`), and thymine (`T`).
|
25
|
+
|
26
|
+
RNA contains a slightly different set of nucleotides, but we don't care
|
27
|
+
about that for now.
|
28
|
+
## Source
|
29
|
+
|
30
|
+
The Calculating DNA Nucleotides_problem at Rosalind [http://rosalind.info/problems/dna/](http://rosalind.info/problems/dna/)
|
31
|
+
|
32
|
+
## Submitting Incomplete Solutions
|
33
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Octal
|
2
|
+
|
3
|
+
Convert an octal number, represented as a string (e.g. '1735263'), to its
|
4
|
+
decimal equivalent using first principles (i.e. no, you may not use built-in or
|
5
|
+
external libraries to accomplish the conversion).
|
6
|
+
|
7
|
+
Implement octal to decimal conversion. Given an octal input
|
8
|
+
string, your program should produce a decimal output.
|
9
|
+
|
10
|
+
## Note
|
11
|
+
- Implement the conversion yourself.
|
12
|
+
Do not use something else to perform the conversion for you.
|
13
|
+
- Treat invalid input as octal 0.
|
14
|
+
|
15
|
+
## About Octal (Base-8)
|
16
|
+
Decimal is a base-10 system.
|
17
|
+
|
18
|
+
A number 233 in base 10 notation can be understood
|
19
|
+
as a linear combination of powers of 10:
|
20
|
+
|
21
|
+
- The rightmost digit gets multiplied by 10^0 = 1
|
22
|
+
- The next number gets multiplied by 10^1 = 10
|
23
|
+
- ...
|
24
|
+
- The *n*th number gets multiplied by 10^*(n-1)*.
|
25
|
+
- All these values are summed.
|
26
|
+
|
27
|
+
So:
|
28
|
+
```
|
29
|
+
233 # decimal
|
30
|
+
= 2*10^2 + 3*10^1 + 3*10^0
|
31
|
+
= 2*100 + 3*10 + 3*1
|
32
|
+
```
|
33
|
+
|
34
|
+
Octal is similar, but uses powers of 8 rather than powers of 10.
|
35
|
+
|
36
|
+
So:
|
37
|
+
```
|
38
|
+
233 # octal
|
39
|
+
= 2*8^2 + 3*8^1 + 3*8^0
|
40
|
+
= 2*64 + 3*8 + 3*1
|
41
|
+
= 128 + 24 + 3
|
42
|
+
= 155
|
43
|
+
```
|
44
|
+
## Source
|
45
|
+
|
46
|
+
All of Computer Science [http://www.wolframalpha.com/input/?i=base+8](http://www.wolframalpha.com/input/?i=base+8)
|
47
|
+
|
48
|
+
## Submitting Incomplete Solutions
|
49
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Pangram
|
2
|
+
|
3
|
+
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
|
4
|
+
"every letter") is a sentence using every letter of the alphabet at least once.
|
5
|
+
The best known English pangram is:
|
6
|
+
> The quick brown fox jumps over the lazy dog.
|
7
|
+
|
8
|
+
The alphabet used consists of ASCII letters `a` to `z`, inclusive, and is case
|
9
|
+
insensitive. Input will not contain non-ASCII symbols.
|
10
|
+
## Source
|
11
|
+
|
12
|
+
Wikipedia [https://en.wikipedia.org/wiki/Pangram](https://en.wikipedia.org/wiki/Pangram)
|
13
|
+
|
14
|
+
## Submitting Incomplete Solutions
|
15
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Pascals Triangle
|
2
|
+
|
3
|
+
Compute Pascal's triangle up to a given number of rows.
|
4
|
+
|
5
|
+
In Pascal's Triangle each number is computed by adding the numbers to
|
6
|
+
the right and left of the current position in the previous row.
|
7
|
+
|
8
|
+
```plain
|
9
|
+
1
|
10
|
+
1 1
|
11
|
+
1 2 1
|
12
|
+
1 3 3 1
|
13
|
+
1 4 6 4 1
|
14
|
+
# ... etc
|
15
|
+
```
|
16
|
+
## Source
|
17
|
+
|
18
|
+
Pascal's Triangle at Wolfram Math World [http://mathworld.wolfram.com/PascalsTriangle.html](http://mathworld.wolfram.com/PascalsTriangle.html)
|
19
|
+
|
20
|
+
## Submitting Incomplete Solutions
|
21
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Perfect Numbers
|
2
|
+
|
3
|
+
Determine if a number is perfect, abundant, or deficient based on
|
4
|
+
Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
|
5
|
+
|
6
|
+
The Greek mathematician [Nicomachus](https://en.wikipedia.org/wiki/Nicomachus) devised a classification scheme for natural numbers, identifying each as belonging uniquely to the categories of **perfect**, **abundant**, or **deficient** based on their [aliquot sum](https://en.wikipedia.org/wiki/Aliquot_sum). The aliquot sum is defined as the sum of the factors of a number not including the number itself. For example, the aliquot sum of 15 is (1 + 3 + 5) = 9
|
7
|
+
|
8
|
+
- **Perfect**: aliquot sum = number
|
9
|
+
- 6 is a perfect number because (1 + 2 + 3) = 6
|
10
|
+
- 28 is a perfect number because (1 + 2 + 4 + 7 + 14) = 28
|
11
|
+
- **Abundant**: aliquot sum > number
|
12
|
+
- 12 is an abundant number because (1 + 2 + 3 + 4 + 6) = 16
|
13
|
+
- 24 is an abundant number because (1 + 2 + 3 + 4 + 6 + 8 + 12) = 36
|
14
|
+
- **Deficient**: aliquot sum < number
|
15
|
+
- 8 is a deficient number because (1 + 2 + 4) = 7
|
16
|
+
- Prime numbers are deficient
|
17
|
+
|
18
|
+
Implement a way to determine whether a given number is **perfect**. Depending on your language track, you may also need to implement a way to determine whether a given number is **abundant** or **deficient**.
|
19
|
+
## Source
|
20
|
+
|
21
|
+
Taken from Chapter 2 of Functional Thinking by Neal Ford. [http://shop.oreilly.com/product/0636920029687.do](http://shop.oreilly.com/product/0636920029687.do)
|
22
|
+
|
23
|
+
## Submitting Incomplete Solutions
|
24
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Phone Number
|
2
|
+
|
3
|
+
Clean up user-entered phone numbers so that they can be sent SMS messages.
|
4
|
+
|
5
|
+
The **North American Numbering Plan (NANP)** is a telephone numbering system used by many countries in North America like the United States, Canada or Bermuda. All NANP-countries share the same international country code: `1`.
|
6
|
+
|
7
|
+
NANP numbers are ten-digit numbers consisting of a three-digit Numbering Plan Area code, commonly known as *area code*, followed by a seven-digit local number. The first three digits of the local number represent the *exchange code*, followed by the unique four-digit number which is the *subscriber number*.
|
8
|
+
|
9
|
+
|
10
|
+
The format is usually represented as
|
11
|
+
```
|
12
|
+
(NXX)-NXX-XXXX
|
13
|
+
```
|
14
|
+
where `N` is any digit from 2 through 9 and `X` is any digit from 0 through 9.
|
15
|
+
|
16
|
+
Your task is to clean up differently formated telephone numbers by removing punctuation and the country code (1) if present.
|
17
|
+
|
18
|
+
For example, the inputs
|
19
|
+
- `+1 (613)-995-0253`
|
20
|
+
- `613-995-0253`
|
21
|
+
- `1 613 995 0253`
|
22
|
+
- `613.995.0253`
|
23
|
+
|
24
|
+
should all produce the output
|
25
|
+
|
26
|
+
`6139950253`
|
27
|
+
|
28
|
+
**Note:** As this exercise only deals with telephone numbers used in NANP-countries, only 1 is considered a valid country code.
|
29
|
+
## Source
|
30
|
+
|
31
|
+
Event Manager by JumpstartLab [http://tutorials.jumpstartlab.com/projects/eventmanager.html](http://tutorials.jumpstartlab.com/projects/eventmanager.html)
|
32
|
+
|
33
|
+
## Submitting Incomplete Solutions
|
34
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Pig Latin
|
2
|
+
|
3
|
+
Implement a program that translates from English to Pig Latin.
|
4
|
+
|
5
|
+
Pig Latin is a made-up children's language that's intended to be
|
6
|
+
confusing. It obeys a few simple rules (below), but when it's spoken
|
7
|
+
quickly it's really difficult for non-children (and non-native speakers)
|
8
|
+
to understand.
|
9
|
+
|
10
|
+
- **Rule 1**: If a word begins with a vowel sound, add an "ay" sound to
|
11
|
+
the end of the word.
|
12
|
+
- **Rule 2**: If a word begins with a consonant sound, move it to the
|
13
|
+
end of the word, and then add an "ay" sound to the end of the word.
|
14
|
+
|
15
|
+
There are a few more rules for edge cases, and there are regional
|
16
|
+
variants too.
|
17
|
+
|
18
|
+
See <http://en.wikipedia.org/wiki/Pig_latin> for more details.
|
19
|
+
## Source
|
20
|
+
|
21
|
+
The Pig Latin exercise at Test First Teaching by Ultrasaurus [https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/](https://github.com/ultrasaurus/test-first-teaching/blob/master/learn_ruby/pig_latin/)
|
22
|
+
|
23
|
+
## Submitting Incomplete Solutions
|
24
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Pov
|
2
|
+
|
3
|
+
Reparent a graph on a selected node.
|
4
|
+
|
5
|
+
# Tree Reparenting
|
6
|
+
|
7
|
+
This exercise is all about re-orientating a graph to see things from a different
|
8
|
+
point of view. For example family trees are usually presented from the
|
9
|
+
ancestor's perspective:
|
10
|
+
|
11
|
+
```
|
12
|
+
+------0------+
|
13
|
+
| | |
|
14
|
+
+-1-+ +-2-+ +-3-+
|
15
|
+
| | | | | |
|
16
|
+
4 5 6 7 8 9
|
17
|
+
```
|
18
|
+
|
19
|
+
But the same information can be presented from the perspective of any other node
|
20
|
+
in the graph, by pulling it up to the root and dragging its relationships along
|
21
|
+
with it. So the same graph from 6's perspective would look like:
|
22
|
+
|
23
|
+
```
|
24
|
+
6
|
25
|
+
|
|
26
|
+
+-----2-----+
|
27
|
+
| |
|
28
|
+
7 +-----0-----+
|
29
|
+
| |
|
30
|
+
+-1-+ +-3-+
|
31
|
+
| | | |
|
32
|
+
4 5 8 9
|
33
|
+
```
|
34
|
+
|
35
|
+
This lets us more simply describe the paths between two nodes. So for example
|
36
|
+
the path from 6-9 (which in the first graph goes up to the root and then down to
|
37
|
+
a different leaf node) can be seen to follow the path 6-2-0-3-9
|
38
|
+
|
39
|
+
This exercise involves taking an input graph and re-orientating it from the point
|
40
|
+
of view of one of the nodes.
|
41
|
+
## Source
|
42
|
+
|
43
|
+
Adaptation of exercise from 4clojure [https://www.4clojure.com/](https://www.4clojure.com/)
|
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,36 @@
|
|
1
|
+
# Prime Factors
|
2
|
+
|
3
|
+
Compute the prime factors of a given natural number.
|
4
|
+
|
5
|
+
A prime number is only evenly divisible by itself and 1.
|
6
|
+
|
7
|
+
Note that 1 is not a prime number.
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
What are the prime factors of 60?
|
12
|
+
|
13
|
+
- Our first divisor is 2. 2 goes into 60, leaving 30.
|
14
|
+
- 2 goes into 30, leaving 15.
|
15
|
+
- 2 doesn't go cleanly into 15. So let's move on to our next divisor, 3.
|
16
|
+
- 3 goes cleanly into 15, leaving 5.
|
17
|
+
- 3 does not go cleanly into 5. The next possible factor is 4.
|
18
|
+
- 4 does not go cleanly into 5. The next possible factor is 5.
|
19
|
+
- 5 does go cleanly into 5.
|
20
|
+
- We're left only with 1, so now, we're done.
|
21
|
+
|
22
|
+
Our successful divisors in that computation represent the list of prime
|
23
|
+
factors of 60: 2, 2, 3, and 5.
|
24
|
+
|
25
|
+
You can check this yourself:
|
26
|
+
|
27
|
+
- 2 * 2 * 3 * 5
|
28
|
+
- = 4 * 15
|
29
|
+
- = 60
|
30
|
+
- Success!
|
31
|
+
## Source
|
32
|
+
|
33
|
+
The Prime Factors Kata by Uncle Bob [http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata](http://butunclebob.com/ArticleS.UncleBob.ThePrimeFactorsKata)
|
34
|
+
|
35
|
+
## Submitting Incomplete Solutions
|
36
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Queen Attack
|
2
|
+
|
3
|
+
Given the position of two queens on a chess board, indicate whether or not they
|
4
|
+
are positioned so that they can attack each other.
|
5
|
+
|
6
|
+
In the game of chess, a queen can attack pieces which are on the same
|
7
|
+
row, column, or diagonal.
|
8
|
+
|
9
|
+
A chessboard can be represented by an 8 by 8 array.
|
10
|
+
|
11
|
+
So if you're told the white queen is at (2, 3) and the black queen at
|
12
|
+
(5, 6), then you'd know you've got a set-up like so:
|
13
|
+
|
14
|
+
```plain
|
15
|
+
_ _ _ _ _ _ _ _
|
16
|
+
_ _ _ _ _ _ _ _
|
17
|
+
_ _ _ W _ _ _ _
|
18
|
+
_ _ _ _ _ _ _ _
|
19
|
+
_ _ _ _ _ _ _ _
|
20
|
+
_ _ _ _ _ _ B _
|
21
|
+
_ _ _ _ _ _ _ _
|
22
|
+
_ _ _ _ _ _ _ _
|
23
|
+
```
|
24
|
+
|
25
|
+
You'd also be able to answer whether the queens can attack each other.
|
26
|
+
In this case, that answer would be yes, they can, because both pieces
|
27
|
+
share a diagonal.
|
28
|
+
## Source
|
29
|
+
|
30
|
+
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)
|
31
|
+
|
32
|
+
## Submitting Incomplete Solutions
|
33
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Raindrops
|
2
|
+
|
3
|
+
Convert a number to a string, the contents of which depend on the number's factors.
|
4
|
+
|
5
|
+
- If the number has 3 as a factor, output 'Pling'.
|
6
|
+
- If the number has 5 as a factor, output 'Plang'.
|
7
|
+
- If the number has 7 as a factor, output 'Plong'.
|
8
|
+
- If the number does not have 3, 5, or 7 as a factor,
|
9
|
+
just pass the number's digits straight through.
|
10
|
+
|
11
|
+
## Examples
|
12
|
+
|
13
|
+
- 28's factors are 1, 2, 4, **7**, 14, 28.
|
14
|
+
- In raindrop-speak, this would be a simple "Plong".
|
15
|
+
- 30's factors are 1, 2, **3**, **5**, 6, 10, 15, 30.
|
16
|
+
- In raindrop-speak, this would be a "PlingPlang".
|
17
|
+
- 34 has four factors: 1, 2, 17, and 34.
|
18
|
+
- In raindrop-speak, this would be "34".
|
19
|
+
## Source
|
20
|
+
|
21
|
+
A variation on a famous interview question intended to weed out potential candidates. [http://jumpstartlab.com](http://jumpstartlab.com)
|
22
|
+
|
23
|
+
## Submitting Incomplete Solutions
|
24
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Rna Transcription
|
2
|
+
|
3
|
+
Given a DNA strand, return its RNA complement (per RNA transcription).
|
4
|
+
|
5
|
+
Both DNA and RNA strands are a sequence of nucleotides.
|
6
|
+
|
7
|
+
The four nucleotides found in DNA are adenine (**A**), cytosine (**C**),
|
8
|
+
guanine (**G**) and thymine (**T**).
|
9
|
+
|
10
|
+
The four nucleotides found in RNA are adenine (**A**), cytosine (**C**),
|
11
|
+
guanine (**G**) and uracil (**U**).
|
12
|
+
|
13
|
+
Given a DNA strand, its transcribed RNA strand is formed by replacing
|
14
|
+
each nucleotide with its complement:
|
15
|
+
|
16
|
+
* `G` -> `C`
|
17
|
+
* `C` -> `G`
|
18
|
+
* `T` -> `A`
|
19
|
+
* `A` -> `U`
|
20
|
+
## Source
|
21
|
+
|
22
|
+
Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna)
|
23
|
+
|
24
|
+
## Submitting Incomplete Solutions
|
25
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Robot Name
|
2
|
+
|
3
|
+
Manage robot factory settings.
|
4
|
+
|
5
|
+
When robots come off the factory floor, they have no name.
|
6
|
+
|
7
|
+
The first time you boot them up, a random name is generated in the format
|
8
|
+
of two uppercase letters followed by three digits, such as RX837 or BC811.
|
9
|
+
|
10
|
+
Every once in a while we need to reset a robot to its factory settings,
|
11
|
+
which means that their name gets wiped. The next time you ask, it will
|
12
|
+
respond with a new random name.
|
13
|
+
|
14
|
+
The names must be random: they should not follow a predictable sequence.
|
15
|
+
Random names means a risk of collisions. Your solution must ensure that
|
16
|
+
every existing robot has a unique name.
|
17
|
+
## Source
|
18
|
+
|
19
|
+
A debugging session with Paul Blackwell at gSchool. [http://gschool.it](http://gschool.it)
|
20
|
+
|
21
|
+
## Submitting Incomplete Solutions
|
22
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# Robot Simulator
|
2
|
+
|
3
|
+
Write a robot simulator.
|
4
|
+
|
5
|
+
A robot factory's test facility needs a program to verify robot movements.
|
6
|
+
|
7
|
+
The robots have three possible movements:
|
8
|
+
|
9
|
+
- turn right
|
10
|
+
- turn left
|
11
|
+
- advance
|
12
|
+
|
13
|
+
Robots are placed on a hypothetical infinite grid, facing a particular
|
14
|
+
direction (north, east, south, or west) at a set of {x,y} coordinates,
|
15
|
+
e.g., {3,8}, with coordinates increasing to the north and east.
|
16
|
+
|
17
|
+
The robot then receives a number of instructions, at which point the
|
18
|
+
testing facility verifies the robot's new position, and in which
|
19
|
+
direction it is pointing.
|
20
|
+
|
21
|
+
- The letter-string "RAALAL" means:
|
22
|
+
- Turn right
|
23
|
+
- Advance twice
|
24
|
+
- Turn left
|
25
|
+
- Advance once
|
26
|
+
- Turn left yet again
|
27
|
+
- Say a robot starts at {7, 3} facing north. Then running this stream
|
28
|
+
of instructions should leave it at {9, 4} facing west.
|
29
|
+
## Source
|
30
|
+
|
31
|
+
Inspired by an interview question at a famous company.
|
32
|
+
|
33
|
+
## Submitting Incomplete Solutions
|
34
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Roman Numerals
|
2
|
+
|
3
|
+
Write a function to convert from normal numbers to Roman Numerals.
|
4
|
+
|
5
|
+
The Romans were a clever bunch. They conquered most of Europe and ruled
|
6
|
+
it for hundreds of years. They invented concrete and straight roads and
|
7
|
+
even bikinis. One thing they never discovered though was the number
|
8
|
+
zero. This made writing and dating extensive histories of their exploits
|
9
|
+
slightly more challenging, but the system of numbers they came up with
|
10
|
+
is still in use today. For example the BBC uses Roman numerals to date
|
11
|
+
their programmes.
|
12
|
+
|
13
|
+
The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice
|
14
|
+
these letters have lots of straight lines and are hence easy to hack
|
15
|
+
into stone tablets).
|
16
|
+
|
17
|
+
```
|
18
|
+
1 => I
|
19
|
+
10 => X
|
20
|
+
7 => VII
|
21
|
+
```
|
22
|
+
|
23
|
+
There is no need to be able to convert numbers larger than about 3000.
|
24
|
+
(The Romans themselves didn't tend to go any higher)
|
25
|
+
|
26
|
+
Wikipedia says: Modern Roman numerals ... are written by expressing each
|
27
|
+
digit separately starting with the left most digit and skipping any
|
28
|
+
digit with a value of zero.
|
29
|
+
|
30
|
+
To see this in practice, consider the example of 1990.
|
31
|
+
|
32
|
+
In Roman numerals 1990 is MCMXC:
|
33
|
+
|
34
|
+
1000=M
|
35
|
+
900=CM
|
36
|
+
90=XC
|
37
|
+
|
38
|
+
2008 is written as MMVIII:
|
39
|
+
|
40
|
+
2000=MM
|
41
|
+
8=VIII
|
42
|
+
|
43
|
+
See also: http://www.novaroma.org/via_romana/numbers.html
|
44
|
+
## Source
|
45
|
+
|
46
|
+
The Roman Numeral Kata [http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals](http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals)
|
47
|
+
|
48
|
+
## Submitting Incomplete Solutions
|
49
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|