trackler 2.2.0.3 → 2.2.0.4
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/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/list-ops/canonical-data.json +27 -11
- data/problem-specifications/exercises/rotational-cipher/canonical-data.json +8 -8
- data/tracks/clojure/config.json +240 -63
- data/tracks/cpp/CMakeLists.txt +1 -0
- data/tracks/cpp/config.json +8 -0
- data/tracks/cpp/exercises/bracket-push/CMakeLists.txt +52 -0
- data/tracks/cpp/exercises/bracket-push/bracket_push_test.cpp +75 -0
- data/tracks/cpp/exercises/bracket-push/example.cpp +28 -0
- data/tracks/cpp/exercises/bracket-push/example.h +13 -0
- data/tracks/ecmascript/config.json +235 -71
- data/tracks/ecmascript/config/exercise_readme.go.tmpl +16 -0
- data/tracks/ecmascript/exercises/accumulate/README.md +65 -0
- data/tracks/ecmascript/exercises/acronym/README.md +45 -0
- data/tracks/ecmascript/exercises/all-your-base/README.md +65 -0
- data/tracks/ecmascript/exercises/allergies/README.md +67 -0
- data/tracks/ecmascript/exercises/alphametics/README.md +65 -0
- data/tracks/ecmascript/exercises/anagram/README.md +43 -0
- data/tracks/ecmascript/exercises/atbash-cipher/README.md +64 -0
- data/tracks/ecmascript/exercises/beer-song/README.md +357 -0
- data/tracks/ecmascript/exercises/binary-search-tree/README.md +90 -0
- data/tracks/ecmascript/exercises/binary-search/README.md +71 -0
- data/tracks/ecmascript/exercises/binary/README.md +65 -0
- data/tracks/ecmascript/exercises/bob/README.md +48 -0
- data/tracks/ecmascript/exercises/bracket-push/README.md +40 -0
- data/tracks/ecmascript/exercises/circular-buffer/README.md +80 -0
- data/tracks/ecmascript/exercises/clock/README.md +43 -0
- data/tracks/ecmascript/exercises/connect/README.md +64 -0
- data/tracks/ecmascript/exercises/crypto-square/README.md +104 -0
- data/tracks/ecmascript/exercises/custom-set/README.md +41 -0
- data/tracks/ecmascript/exercises/diamond/README.md +89 -0
- data/tracks/ecmascript/exercises/difference-of-squares/README.md +49 -0
- data/tracks/ecmascript/exercises/diffie-hellman/README.md +74 -0
- data/tracks/ecmascript/exercises/etl/README.md +81 -0
- data/tracks/ecmascript/exercises/flatten-array/README.md +48 -0
- data/tracks/ecmascript/exercises/food-chain/README.md +100 -0
- data/tracks/ecmascript/exercises/gigasecond/README.md +41 -0
- data/tracks/ecmascript/exercises/grade-school/README.md +72 -0
- data/tracks/ecmascript/exercises/grains/README.md +64 -0
- data/tracks/ecmascript/exercises/hamming/README.md +72 -0
- data/tracks/ecmascript/exercises/hello-world/README.md +51 -0
- data/tracks/ecmascript/exercises/hexadecimal/README.md +44 -0
- data/tracks/ecmascript/exercises/isogram/README.md +49 -0
- data/tracks/ecmascript/exercises/kindergarten-garden/README.md +96 -0
- data/tracks/ecmascript/exercises/largest-series-product/README.md +50 -0
- data/tracks/ecmascript/exercises/leap/README.md +63 -0
- data/tracks/ecmascript/exercises/linked-list/README.md +64 -0
- data/tracks/ecmascript/exercises/list-ops/README.md +40 -0
- data/tracks/ecmascript/exercises/luhn/README.md +101 -0
- data/tracks/ecmascript/exercises/matrix/README.md +75 -0
- data/tracks/ecmascript/exercises/meetup/README.md +60 -0
- data/tracks/ecmascript/exercises/minesweeper/README.md +60 -0
- data/tracks/ecmascript/exercises/nth-prime/README.md +45 -0
- data/tracks/ecmascript/exercises/ocr-numbers/README.md +115 -0
- data/tracks/ecmascript/exercises/octal/README.md +79 -0
- data/tracks/ecmascript/exercises/palindrome-products/README.md +70 -0
- data/tracks/ecmascript/exercises/pangram/README.md +45 -0
- data/tracks/ecmascript/exercises/pascals-triangle/README.md +51 -0
- data/tracks/ecmascript/exercises/perfect-numbers/README.md +54 -0
- data/tracks/ecmascript/exercises/phone-number/README.md +64 -0
- data/tracks/ecmascript/exercises/pig-latin/README.md +54 -0
- data/tracks/ecmascript/exercises/prime-factors/README.md +66 -0
- data/tracks/ecmascript/exercises/pythagorean-triplet/README.md +54 -0
- data/tracks/ecmascript/exercises/queen-attack/README.md +63 -0
- data/tracks/ecmascript/exercises/raindrops/README.md +54 -0
- data/tracks/ecmascript/exercises/rna-transcription/README.md +55 -0
- data/tracks/ecmascript/exercises/robot-name/README.md +52 -0
- data/tracks/ecmascript/exercises/robot-simulator/README.md +64 -0
- data/tracks/ecmascript/exercises/roman-numerals/README.md +79 -0
- data/tracks/ecmascript/exercises/saddle-points/README.md +63 -0
- data/tracks/ecmascript/exercises/say/README.md +99 -0
- data/tracks/ecmascript/exercises/scrabble-score/README.md +74 -0
- data/tracks/ecmascript/exercises/secret-handshake/README.md +65 -0
- data/tracks/ecmascript/exercises/series/README.md +57 -0
- data/tracks/ecmascript/exercises/sieve/README.md +64 -0
- data/tracks/ecmascript/exercises/simple-cipher/README.md +120 -0
- data/tracks/ecmascript/exercises/space-age/README.md +54 -0
- data/tracks/ecmascript/exercises/strain/README.md +70 -0
- data/tracks/ecmascript/exercises/sublist/README.md +50 -0
- data/tracks/ecmascript/exercises/sublist/example.js +30 -0
- data/tracks/ecmascript/exercises/sublist/package.json +69 -0
- data/tracks/ecmascript/exercises/sublist/sublist.spec.js +126 -0
- data/tracks/ecmascript/exercises/sum-of-multiples/README.md +48 -0
- data/tracks/ecmascript/exercises/triangle/README.md +56 -0
- data/tracks/ecmascript/exercises/trinary/README.md +58 -0
- data/tracks/ecmascript/exercises/two-bucket/README.md +66 -0
- data/tracks/ecmascript/exercises/word-count/README.md +49 -0
- data/tracks/ecmascript/exercises/wordy/README.md +93 -0
- data/tracks/go/.gitignore +1 -0
- data/tracks/go/README.md +2 -0
- data/tracks/go/config/exercise_readme.go.tmpl +16 -0
- data/tracks/go/exercises/accumulate/README.md +53 -0
- data/tracks/go/exercises/acronym/README.md +33 -0
- data/tracks/go/exercises/all-your-base/README.md +53 -0
- data/tracks/go/exercises/allergies/README.md +55 -0
- data/tracks/go/exercises/anagram/README.md +31 -0
- data/tracks/go/exercises/atbash-cipher/README.md +52 -0
- data/tracks/go/exercises/bank-account/README.md +48 -0
- data/tracks/go/exercises/beer-song/README.md +345 -0
- data/tracks/go/exercises/binary-search-tree/README.md +78 -0
- data/tracks/go/exercises/binary-search/README.md +59 -0
- data/tracks/go/exercises/binary/README.md +53 -0
- data/tracks/go/exercises/bob/README.md +36 -0
- data/tracks/go/exercises/bowling/README.md +71 -0
- data/tracks/go/exercises/bracket-push/README.md +28 -0
- data/tracks/go/exercises/change/README.md +41 -0
- data/tracks/go/exercises/circular-buffer/README.md +68 -0
- data/tracks/go/exercises/clock/README.md +31 -0
- data/tracks/go/exercises/connect/README.md +52 -0
- data/tracks/go/exercises/counter/README.md +42 -0
- data/tracks/go/exercises/crypto-square/README.md +92 -0
- data/tracks/go/exercises/custom-set/README.md +29 -0
- data/tracks/go/exercises/diamond/README.md +77 -0
- data/tracks/go/exercises/difference-of-squares/README.md +37 -0
- data/tracks/go/exercises/diffie-hellman/README.md +62 -0
- data/tracks/go/exercises/error-handling/README.md +31 -0
- data/tracks/go/exercises/etl/README.md +69 -0
- data/tracks/go/exercises/food-chain/README.md +88 -0
- data/tracks/go/exercises/forth/README.md +47 -0
- data/tracks/go/exercises/gigasecond/README.md +29 -0
- data/tracks/go/exercises/grade-school/README.md +60 -0
- data/tracks/go/exercises/grains/README.md +52 -0
- data/tracks/go/exercises/hamming/README.md +60 -0
- data/tracks/go/exercises/hello-world/README.md +39 -0
- data/tracks/go/exercises/hexadecimal/README.md +32 -0
- data/tracks/go/exercises/house/README.md +131 -0
- data/tracks/go/exercises/isogram/README.md +37 -0
- data/tracks/go/exercises/kindergarten-garden/README.md +84 -0
- data/tracks/go/exercises/largest-series-product/README.md +38 -0
- data/tracks/go/exercises/leap/README.md +51 -0
- data/tracks/go/exercises/ledger/README.md +36 -0
- data/tracks/go/exercises/luhn/README.md +89 -0
- data/tracks/go/exercises/matrix/README.md +63 -0
- data/tracks/go/exercises/meetup/README.md +48 -0
- data/tracks/go/exercises/minesweeper/README.md +48 -0
- data/tracks/go/exercises/nth-prime/README.md +33 -0
- data/tracks/go/exercises/nucleotide-count/README.md +51 -0
- data/tracks/go/exercises/ocr-numbers/README.md +103 -0
- data/tracks/go/exercises/octal/README.md +67 -0
- data/tracks/go/exercises/paasio/README.md +38 -0
- data/tracks/go/exercises/palindrome-products/README.md +58 -0
- data/tracks/go/exercises/pangram/README.md +33 -0
- data/tracks/go/exercises/parallel-letter-frequency/README.md +29 -0
- data/tracks/go/exercises/pascals-triangle/README.md +39 -0
- data/tracks/go/exercises/perfect-numbers/README.md +42 -0
- data/tracks/go/exercises/phone-number/README.md +52 -0
- data/tracks/go/exercises/pig-latin/README.md +42 -0
- data/tracks/go/exercises/poker/README.md +30 -0
- data/tracks/go/exercises/pov/README.md +64 -0
- data/tracks/go/exercises/prime-factors/README.md +54 -0
- data/tracks/go/exercises/protein-translation/README.md +67 -0
- data/tracks/go/exercises/pythagorean-triplet/README.md +42 -0
- data/tracks/go/exercises/queen-attack/README.md +51 -0
- data/tracks/go/exercises/raindrops/README.md +42 -0
- data/tracks/go/exercises/react/README.md +37 -0
- data/tracks/go/exercises/rna-transcription/README.md +43 -0
- data/tracks/go/exercises/robot-name/README.md +40 -0
- data/tracks/go/exercises/robot-simulator/README.md +52 -0
- data/tracks/go/exercises/roman-numerals/README.md +67 -0
- data/tracks/go/exercises/saddle-points/README.md +51 -0
- data/tracks/go/exercises/say/README.md +87 -0
- data/tracks/go/exercises/scrabble-score/README.md +62 -0
- data/tracks/go/exercises/secret-handshake/README.md +53 -0
- data/tracks/go/exercises/series/README.md +45 -0
- data/tracks/go/exercises/sieve/README.md +52 -0
- data/tracks/go/exercises/simple-cipher/README.md +108 -0
- data/tracks/go/exercises/strain/README.md +58 -0
- data/tracks/go/exercises/sum-of-multiples/README.md +36 -0
- data/tracks/go/exercises/tournament/README.md +86 -0
- data/tracks/go/exercises/transpose/README.md +83 -0
- data/tracks/go/exercises/tree-building/README.md +48 -0
- data/tracks/go/exercises/triangle/README.md +44 -0
- data/tracks/go/exercises/trinary/README.md +46 -0
- data/tracks/go/exercises/twelve-days/README.md +57 -0
- data/tracks/go/exercises/variable-length-quantity/README.md +57 -0
- data/tracks/go/exercises/word-count/README.md +37 -0
- data/tracks/go/exercises/word-search/README.md +48 -0
- data/tracks/go/exercises/wordy/README.md +81 -0
- data/tracks/haskell/README.md +2 -2
- data/tracks/haskell/exercises/beer-song/test/Tests.hs +1 -1
- data/tracks/haskell/exercises/food-chain/test/Tests.hs +1 -1
- data/tracks/haskell/exercises/house/test/Tests.hs +1 -1
- data/tracks/haskell/exercises/say/test/Tests.hs +1 -1
- data/tracks/java/config.json +10 -10
- data/tracks/java/exercises/rotational-cipher/src/example/java/RotationalCipher.java +5 -8
- data/tracks/java/exercises/rotational-cipher/src/test/java/RotationalCipherTest.java +3 -6
- data/tracks/javascript/config.json +397 -140
- data/tracks/kotlin/config.json +248 -63
- data/tracks/kotlin/config/exercise_readme.go.tmpl +16 -0
- data/tracks/kotlin/exercises/accumulate/README.md +38 -0
- data/tracks/kotlin/exercises/acronym/README.md +18 -0
- data/tracks/kotlin/exercises/all-your-base/README.md +38 -0
- data/tracks/kotlin/exercises/allergies/README.md +40 -0
- data/tracks/kotlin/exercises/anagram/README.md +16 -0
- data/tracks/kotlin/exercises/atbash-cipher/README.md +37 -0
- data/tracks/kotlin/exercises/bank-account/README.md +33 -0
- data/tracks/kotlin/exercises/beer-song/README.md +330 -0
- data/tracks/kotlin/exercises/binary-search/README.md +44 -0
- data/tracks/kotlin/exercises/binary/README.md +38 -0
- data/tracks/kotlin/exercises/bob/README.md +21 -0
- data/tracks/kotlin/exercises/bracket-push/README.md +13 -0
- data/tracks/kotlin/exercises/change/README.md +26 -0
- data/tracks/kotlin/exercises/clock/README.md +16 -0
- data/tracks/kotlin/exercises/collatz-conjecture/README.md +36 -0
- data/tracks/kotlin/exercises/complex-numbers/README.md +14 -0
- data/tracks/kotlin/exercises/diamond/README.md +62 -0
- data/tracks/kotlin/exercises/difference-of-squares/README.md +22 -0
- data/tracks/kotlin/exercises/etl/README.md +54 -0
- data/tracks/kotlin/exercises/flatten-array/README.md +21 -0
- data/tracks/kotlin/exercises/gigasecond/README.md +14 -0
- data/tracks/kotlin/exercises/grade-school/README.md +45 -0
- data/tracks/kotlin/exercises/grains/README.md +37 -0
- data/tracks/kotlin/exercises/hamming/README.md +45 -0
- data/tracks/kotlin/exercises/hello-world/README.md +24 -0
- data/tracks/kotlin/exercises/hexadecimal/README.md +17 -0
- data/tracks/kotlin/exercises/isogram/README.md +22 -0
- data/tracks/kotlin/exercises/largest-series-product/README.md +23 -0
- data/tracks/kotlin/exercises/leap/README.md +36 -0
- data/tracks/kotlin/exercises/linked-list/README.md +37 -0
- data/tracks/kotlin/exercises/list-ops/README.md +20 -0
- data/tracks/kotlin/exercises/luhn/README.md +74 -0
- data/tracks/kotlin/exercises/minesweeper/README.md +33 -0
- data/tracks/kotlin/exercises/nth-prime/README.md +18 -0
- data/tracks/kotlin/exercises/nucleotide-count/README.md +36 -0
- data/tracks/kotlin/exercises/pangram/README.md +18 -0
- data/tracks/kotlin/exercises/pascals-triangle/README.md +24 -0
- data/tracks/kotlin/exercises/perfect-numbers/README.md +27 -0
- data/tracks/kotlin/exercises/phone-number/README.md +37 -0
- data/tracks/kotlin/exercises/pig-latin/README.md +27 -0
- data/tracks/kotlin/exercises/prime-factors/README.md +39 -0
- data/tracks/kotlin/exercises/raindrops/README.md +27 -0
- data/tracks/kotlin/exercises/react/README.md +22 -0
- data/tracks/kotlin/exercises/rna-transcription/README.md +28 -0
- data/tracks/kotlin/exercises/robot-name/README.md +25 -0
- data/tracks/kotlin/exercises/robot-simulator/README.md +37 -0
- data/tracks/kotlin/exercises/roman-numerals/README.md +52 -0
- data/tracks/kotlin/exercises/saddle-points/README.md +36 -0
- data/tracks/kotlin/exercises/scrabble-score/README.md +47 -0
- data/tracks/kotlin/exercises/secret-handshake/README.md +38 -0
- data/tracks/kotlin/exercises/series/README.md +30 -0
- data/tracks/kotlin/exercises/sieve/README.md +37 -0
- data/tracks/kotlin/exercises/simple-cipher/README.md +93 -0
- data/tracks/kotlin/exercises/space-age/README.md +27 -0
- data/tracks/kotlin/exercises/spiral-matrix/README.md +33 -0
- data/tracks/kotlin/exercises/strain/README.md +43 -0
- data/tracks/kotlin/exercises/sublist/README.md +24 -0
- data/tracks/kotlin/exercises/sum-of-multiples/README.md +21 -0
- data/tracks/kotlin/exercises/triangle/README.md +29 -0
- data/tracks/kotlin/exercises/word-count/README.md +22 -0
- data/tracks/ocaml/config/exercise_readme.go.tmpl +16 -0
- data/tracks/ocaml/exercises/acronym/README.md +55 -0
- data/tracks/ocaml/exercises/all-your-base/README.md +75 -0
- data/tracks/ocaml/exercises/anagram/README.md +53 -0
- data/tracks/ocaml/exercises/atbash-cipher/README.md +93 -0
- data/tracks/ocaml/exercises/beer-song/README.md +367 -0
- data/tracks/ocaml/exercises/binary-search/README.md +81 -0
- data/tracks/ocaml/exercises/bob/README.md +87 -0
- data/tracks/ocaml/exercises/bowling/README.md +93 -0
- data/tracks/ocaml/exercises/bracket-push/README.md +50 -0
- data/tracks/ocaml/exercises/change/README.md +63 -0
- data/tracks/ocaml/exercises/connect/README.md +74 -0
- data/tracks/ocaml/exercises/custom-set/README.md +51 -0
- data/tracks/ocaml/exercises/difference-of-squares/README.md +59 -0
- data/tracks/ocaml/exercises/dominoes/README.md +58 -0
- data/tracks/ocaml/exercises/etl/README.md +91 -0
- data/tracks/ocaml/exercises/forth/README.md +69 -0
- data/tracks/ocaml/exercises/grade-school/README.md +82 -0
- data/tracks/ocaml/exercises/hamming/README.md +82 -0
- data/tracks/ocaml/exercises/hangman/README.md +61 -0
- data/tracks/ocaml/exercises/hello-world/README.md +61 -0
- data/tracks/ocaml/exercises/hexadecimal/README.md +54 -0
- data/tracks/ocaml/exercises/leap/README.md +73 -0
- data/tracks/ocaml/exercises/list-ops/README.md +50 -0
- data/tracks/ocaml/exercises/luhn/README.md +111 -0
- data/tracks/ocaml/exercises/meetup/README.md +70 -0
- data/tracks/ocaml/exercises/minesweeper/README.md +70 -0
- data/tracks/ocaml/exercises/nucleotide-count/README.md +73 -0
- data/tracks/ocaml/exercises/pangram/README.md +55 -0
- data/tracks/ocaml/exercises/phone-number/README.md +74 -0
- data/tracks/ocaml/exercises/point-mutations/README.md +81 -0
- data/tracks/ocaml/exercises/prime-factors/README.md +76 -0
- data/tracks/ocaml/exercises/raindrops/README.md +64 -0
- data/tracks/ocaml/exercises/react/README.md +59 -0
- data/tracks/ocaml/exercises/rna-transcription/README.md +65 -0
- data/tracks/ocaml/exercises/robot-name/README.md +62 -0
- data/tracks/ocaml/exercises/roman-numerals/README.md +89 -0
- data/tracks/ocaml/exercises/run-length-encoding/README.md +70 -0
- data/tracks/ocaml/exercises/say/README.md +109 -0
- data/tracks/ocaml/exercises/space-age/README.md +64 -0
- data/tracks/ocaml/exercises/triangle/README.md +66 -0
- data/tracks/ocaml/exercises/word-count/README.md +59 -0
- data/tracks/ocaml/exercises/zipper/README.md +71 -0
- data/tracks/perl5/README.md +1 -1
- data/tracks/perl5/config/exercise_readme.go.tmpl +16 -0
- data/tracks/perl5/exercises/accumulate/README.md +35 -0
- data/tracks/perl5/exercises/all-your-base/README.md +35 -0
- data/tracks/perl5/exercises/allergies/README.md +37 -0
- data/tracks/perl5/exercises/anagram/README.md +13 -0
- data/tracks/perl5/exercises/atbash-cipher/README.md +34 -0
- data/tracks/perl5/exercises/beer-song/README.md +327 -0
- data/tracks/perl5/exercises/binary-search-tree/README.md +60 -0
- data/tracks/perl5/exercises/binary-search/README.md +41 -0
- data/tracks/perl5/exercises/binary/README.md +35 -0
- data/tracks/perl5/exercises/bob/README.md +18 -0
- data/tracks/perl5/exercises/clock/README.md +13 -0
- data/tracks/perl5/exercises/crypto-square/README.md +74 -0
- data/tracks/perl5/exercises/custom-set/README.md +11 -0
- data/tracks/perl5/exercises/difference-of-squares/README.md +19 -0
- data/tracks/perl5/exercises/etl/README.md +51 -0
- data/tracks/perl5/exercises/food-chain/README.md +70 -0
- data/tracks/perl5/exercises/gigasecond/README.md +11 -0
- data/tracks/perl5/exercises/grade-school/README.md +42 -0
- data/tracks/perl5/exercises/grains/README.md +34 -0
- data/tracks/perl5/exercises/hamming/README.md +42 -0
- data/tracks/perl5/exercises/hello-world/README.md +21 -0
- data/tracks/perl5/exercises/hexadecimal/README.md +14 -0
- data/tracks/perl5/exercises/house/README.md +113 -0
- data/tracks/perl5/exercises/kindergarten-garden/README.md +66 -0
- data/tracks/perl5/exercises/largest-series-product/README.md +20 -0
- data/tracks/perl5/exercises/leap/README.md +33 -0
- data/tracks/perl5/exercises/linked-list/README.md +34 -0
- data/tracks/perl5/exercises/list-ops/README.md +10 -0
- data/tracks/perl5/exercises/luhn/Example.pm +20 -42
- data/tracks/perl5/exercises/luhn/Luhn.pm +9 -0
- data/tracks/perl5/exercises/luhn/README.md +71 -0
- data/tracks/perl5/exercises/luhn/example.yaml +38 -0
- data/tracks/perl5/exercises/luhn/luhn.t +127 -26
- data/tracks/perl5/exercises/matrix/README.md +45 -0
- data/tracks/perl5/exercises/meetup/README.md +30 -0
- data/tracks/perl5/exercises/minesweeper/README.md +30 -0
- data/tracks/perl5/exercises/nucleotide-count/README.md +33 -0
- data/tracks/perl5/exercises/ocr-numbers/README.md +85 -0
- data/tracks/perl5/exercises/palindrome-products/README.md +40 -0
- data/tracks/perl5/exercises/pascals-triangle/README.md +21 -0
- data/tracks/perl5/exercises/phone-number/Example.pm +6 -26
- data/tracks/perl5/exercises/phone-number/PhoneNumber.pm +5 -0
- data/tracks/perl5/exercises/phone-number/README.md +34 -0
- data/tracks/perl5/exercises/phone-number/example.yaml +15 -0
- data/tracks/perl5/exercises/phone-number/phone-number.t +138 -0
- data/tracks/perl5/exercises/pig-latin/README.md +24 -0
- data/tracks/perl5/exercises/point-mutations/README.md +41 -0
- data/tracks/perl5/exercises/prime-factors/README.md +36 -0
- data/tracks/perl5/exercises/proverb/README.md +18 -0
- data/tracks/perl5/exercises/pythagorean-triplet/README.md +24 -0
- data/tracks/perl5/exercises/queen-attack/README.md +33 -0
- data/tracks/perl5/exercises/raindrops/README.md +24 -0
- data/tracks/perl5/exercises/rna-transcription/README.md +25 -0
- data/tracks/perl5/exercises/robot-name/README.md +22 -0
- data/tracks/perl5/exercises/robot-simulator/README.md +34 -0
- data/tracks/perl5/exercises/roman-numerals/README.md +49 -0
- data/tracks/perl5/exercises/saddle-points/README.md +33 -0
- data/tracks/perl5/exercises/say/README.md +69 -0
- data/tracks/perl5/exercises/scrabble-score/README.md +44 -0
- data/tracks/perl5/exercises/secret-handshake/README.md +35 -0
- data/tracks/perl5/exercises/series/README.md +27 -0
- data/tracks/perl5/exercises/sieve/README.md +34 -0
- data/tracks/perl5/exercises/simple-cipher/README.md +90 -0
- data/tracks/perl5/exercises/simple-linked-list/README.md +28 -0
- data/tracks/perl5/exercises/space-age/README.md +24 -0
- data/tracks/perl5/exercises/strain/README.md +40 -0
- data/tracks/perl5/exercises/sublist/README.md +21 -0
- data/tracks/perl5/exercises/sum-of-multiples/README.md +18 -0
- data/tracks/perl5/exercises/triangle/README.md +26 -0
- data/tracks/perl5/exercises/trinary/README.md +28 -0
- data/tracks/perl5/exercises/twelve-days/README.md +35 -0
- data/tracks/perl5/exercises/word-count/README.md +19 -0
- data/tracks/perl5/exercises/wordy/README.md +63 -0
- data/tracks/perl6/README.md +1 -1
- data/tracks/perl6/config/exercise_readme.go.tmpl +16 -0
- data/tracks/perl6/exercises/accumulate/README.md +50 -0
- data/tracks/perl6/exercises/all-your-base/README.md +50 -0
- data/tracks/perl6/exercises/allergies/README.md +52 -0
- data/tracks/perl6/exercises/anagram/README.md +28 -0
- data/tracks/perl6/exercises/atbash-cipher/README.md +49 -0
- data/tracks/perl6/exercises/binary/README.md +50 -0
- data/tracks/perl6/exercises/bob/README.md +33 -0
- data/tracks/perl6/exercises/clock/README.md +28 -0
- data/tracks/perl6/exercises/flatten-array/README.md +33 -0
- data/tracks/perl6/exercises/grade-school/README.md +57 -0
- data/tracks/perl6/exercises/grains/README.md +49 -0
- data/tracks/perl6/exercises/hello-world/README.md +36 -0
- data/tracks/perl6/exercises/leap/README.md +48 -0
- data/tracks/perl6/exercises/linked-list/README.md +49 -0
- data/tracks/perl6/exercises/linked-list/example.yaml +1 -1
- data/tracks/perl6/exercises/linked-list/linked-list.t +1 -1
- data/tracks/perl6/exercises/luhn/README.md +86 -0
- data/tracks/perl6/exercises/phone-number/README.md +49 -0
- data/tracks/perl6/exercises/raindrops/README.md +39 -0
- data/tracks/perl6/exercises/rna-transcription/README.md +40 -0
- data/tracks/perl6/exercises/robot-name/README.md +37 -0
- data/tracks/perl6/exercises/scrabble-score/README.md +59 -0
- data/tracks/perl6/exercises/space-age/README.md +39 -0
- data/tracks/perl6/exercises/trinary/README.md +43 -0
- data/tracks/perl6/exercises/word-count/README.md +34 -0
- data/tracks/perl6/exercises/wordy/README.md +78 -0
- data/tracks/php/config.json +156 -3
- data/tracks/php/config/exercise_readme.go.tmpl +16 -0
- data/tracks/php/exercises/accumulate/README.md +50 -0
- data/tracks/php/exercises/acronym/README.md +30 -0
- data/tracks/php/exercises/allergies/README.md +52 -0
- data/tracks/php/exercises/anagram/README.md +28 -0
- data/tracks/php/exercises/atbash-cipher/README.md +49 -0
- data/tracks/php/exercises/beer-song/README.md +342 -0
- data/tracks/php/exercises/binary-search/README.md +56 -0
- data/tracks/php/exercises/binary/README.md +50 -0
- data/tracks/php/exercises/bob/README.md +36 -0
- data/tracks/php/exercises/book-store/README.md +89 -0
- data/tracks/php/exercises/bowling/README.md +68 -0
- data/tracks/php/exercises/bracket-push/README.md +25 -0
- data/tracks/php/exercises/change/README.md +38 -0
- data/tracks/php/exercises/clock/README.md +28 -0
- data/tracks/php/exercises/connect/README.md +49 -0
- data/tracks/php/exercises/difference-of-squares/README.md +34 -0
- data/tracks/php/exercises/etl/README.md +66 -0
- data/tracks/php/exercises/gigasecond/README.md +26 -0
- data/tracks/php/exercises/grade-school/README.md +57 -0
- data/tracks/php/exercises/grains/README.md +49 -0
- data/tracks/php/exercises/hamming/README.md +57 -0
- data/tracks/php/exercises/hello-world/README.md +36 -0
- data/tracks/php/exercises/isogram/README.md +34 -0
- data/tracks/php/exercises/largest-series-product/README.md +35 -0
- data/tracks/php/exercises/leap/README.md +48 -0
- data/tracks/php/exercises/luhn/README.md +86 -0
- data/tracks/php/exercises/markdown/README.md +33 -0
- data/tracks/php/exercises/minesweeper/README.md +45 -0
- data/tracks/php/exercises/nth-prime/README.md +30 -0
- data/tracks/php/exercises/nucleotide-count/README.md +48 -0
- data/tracks/php/exercises/ocr-numbers/README.md +100 -0
- data/tracks/php/exercises/pangram/README.md +30 -0
- data/tracks/php/exercises/pascals-triangle/README.md +36 -0
- data/tracks/php/exercises/perfect-numbers/README.md +39 -0
- data/tracks/php/exercises/phone-number/README.md +49 -0
- data/tracks/php/exercises/pig-latin/README.md +39 -0
- data/tracks/php/exercises/prime-factors/README.md +51 -0
- data/tracks/php/exercises/queen-attack/README.md +48 -0
- data/tracks/php/exercises/raindrops/README.md +39 -0
- data/tracks/php/exercises/rna-transcription/README.md +40 -0
- data/tracks/php/exercises/robot-name/README.md +37 -0
- data/tracks/php/exercises/robot-simulator/README.md +49 -0
- data/tracks/php/exercises/roman-numerals/README.md +64 -0
- data/tracks/php/exercises/scrabble-score/README.md +59 -0
- data/tracks/php/exercises/sieve/README.md +49 -0
- data/tracks/php/exercises/space-age/README.md +39 -0
- data/tracks/php/exercises/sum-of-multiples/README.md +33 -0
- data/tracks/php/exercises/triangle/README.md +41 -0
- data/tracks/php/exercises/trinary/README.md +43 -0
- data/tracks/php/exercises/variable-length-quantity/README.md +54 -0
- data/tracks/php/exercises/word-count/README.md +34 -0
- data/tracks/php/exercises/wordy/README.md +78 -0
- data/tracks/rust/exercises/grains/tests/grains.rs +0 -1
- data/tracks/sml/config/exercise_readme.go.tmpl +16 -0
- data/tracks/sml/exercises/accumulate/README.md +49 -0
- data/tracks/sml/exercises/allergies/README.md +51 -0
- data/tracks/sml/exercises/anagram/README.md +27 -0
- data/tracks/sml/exercises/binary/README.md +49 -0
- data/tracks/sml/exercises/flatten-array/README.md +32 -0
- data/tracks/sml/exercises/hamming/README.md +56 -0
- data/tracks/sml/exercises/nth-prime/README.md +29 -0
- data/tracks/sml/exercises/raindrops/README.md +38 -0
- metadata +433 -4
- data/tracks/perl5/exercises/phone-number/cases.json +0 -44
- data/tracks/perl5/exercises/phone-number/phone.t +0 -43
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Binary Search
|
|
2
|
+
|
|
3
|
+
Implement a binary search algorithm.
|
|
4
|
+
|
|
5
|
+
Searching a sorted collection is a common task. A dictionary is a sorted
|
|
6
|
+
list of word definitions. Given a word, one can find its definition. A
|
|
7
|
+
telephone book is a sorted list of people's names, addresses, and
|
|
8
|
+
telephone numbers. Knowing someone's name allows one to quickly find
|
|
9
|
+
their telephone number and address.
|
|
10
|
+
|
|
11
|
+
If the list to be searched contains more than a few items (a dozen, say)
|
|
12
|
+
a binary search will require far fewer comparisons than a linear search,
|
|
13
|
+
but it imposes the requirement that the list be sorted.
|
|
14
|
+
|
|
15
|
+
In computer science, a binary search or half-interval search algorithm
|
|
16
|
+
finds the position of a specified input value (the search "key") within
|
|
17
|
+
an array sorted by key value.
|
|
18
|
+
|
|
19
|
+
In each step, the algorithm compares the search key value with the key
|
|
20
|
+
value of the middle element of the array.
|
|
21
|
+
|
|
22
|
+
If the keys match, then a matching element has been found and its index,
|
|
23
|
+
or position, is returned.
|
|
24
|
+
|
|
25
|
+
Otherwise, if the search key is less than the middle element's key, then
|
|
26
|
+
the algorithm repeats its action on the sub-array to the left of the
|
|
27
|
+
middle element or, if the search key is greater, on the sub-array to the
|
|
28
|
+
right.
|
|
29
|
+
|
|
30
|
+
If the remaining array to be searched is empty, then the key cannot be
|
|
31
|
+
found in the array and a special "not found" indication is returned.
|
|
32
|
+
|
|
33
|
+
A binary search halves the number of items to check with each iteration,
|
|
34
|
+
so locating an item (or determining its absence) takes logarithmic time.
|
|
35
|
+
A binary search is a dichotomic divide and conquer search algorithm.
|
|
36
|
+
|
|
37
|
+
## Running the tests
|
|
38
|
+
|
|
39
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
40
|
+
|
|
41
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
42
|
+
flag:
|
|
43
|
+
|
|
44
|
+
go test -bench .
|
|
45
|
+
|
|
46
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
47
|
+
different specs, so the results from these benchmark tests may vary.
|
|
48
|
+
|
|
49
|
+
## Further information
|
|
50
|
+
|
|
51
|
+
For more detailed information about the Go track, including how to get help if
|
|
52
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
53
|
+
|
|
54
|
+
## Source
|
|
55
|
+
|
|
56
|
+
Wikipedia [http://en.wikipedia.org/wiki/Binary_search_algorithm](http://en.wikipedia.org/wiki/Binary_search_algorithm)
|
|
57
|
+
|
|
58
|
+
## Submitting Incomplete Solutions
|
|
59
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Binary
|
|
2
|
+
|
|
3
|
+
Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles.
|
|
4
|
+
|
|
5
|
+
Implement binary to decimal conversion. Given a binary input
|
|
6
|
+
string, your program should produce a decimal output. The
|
|
7
|
+
program should handle invalid inputs.
|
|
8
|
+
|
|
9
|
+
## Note
|
|
10
|
+
- Implement the conversion yourself.
|
|
11
|
+
Do not use something else to perform the conversion for you.
|
|
12
|
+
|
|
13
|
+
## About Binary (Base-2)
|
|
14
|
+
Decimal is a base-10 system.
|
|
15
|
+
|
|
16
|
+
A number 23 in base 10 notation can be understood
|
|
17
|
+
as a linear combination of powers of 10:
|
|
18
|
+
|
|
19
|
+
- The rightmost digit gets multiplied by 10^0 = 1
|
|
20
|
+
- The next number gets multiplied by 10^1 = 10
|
|
21
|
+
- ...
|
|
22
|
+
- The *n*th number gets multiplied by 10^*(n-1)*.
|
|
23
|
+
- All these values are summed.
|
|
24
|
+
|
|
25
|
+
So: `23 => 2*10^1 + 3*10^0 => 2*10 + 3*1 = 23 base 10`
|
|
26
|
+
|
|
27
|
+
Binary is similar, but uses powers of 2 rather than powers of 10.
|
|
28
|
+
|
|
29
|
+
So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`.
|
|
30
|
+
|
|
31
|
+
## Running the tests
|
|
32
|
+
|
|
33
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
34
|
+
|
|
35
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
36
|
+
flag:
|
|
37
|
+
|
|
38
|
+
go test -bench .
|
|
39
|
+
|
|
40
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
41
|
+
different specs, so the results from these benchmark tests may vary.
|
|
42
|
+
|
|
43
|
+
## Further information
|
|
44
|
+
|
|
45
|
+
For more detailed information about the Go track, including how to get help if
|
|
46
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
47
|
+
|
|
48
|
+
## Source
|
|
49
|
+
|
|
50
|
+
All of Computer Science [http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-)
|
|
51
|
+
|
|
52
|
+
## Submitting Incomplete Solutions
|
|
53
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Bob
|
|
2
|
+
|
|
3
|
+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
|
|
4
|
+
|
|
5
|
+
Bob answers 'Sure.' if you ask him a question.
|
|
6
|
+
|
|
7
|
+
He answers 'Whoa, chill out!' if you yell at him.
|
|
8
|
+
|
|
9
|
+
He says 'Fine. Be that way!' if you address him without actually saying
|
|
10
|
+
anything.
|
|
11
|
+
|
|
12
|
+
He answers 'Whatever.' to anything else.
|
|
13
|
+
|
|
14
|
+
## Running the tests
|
|
15
|
+
|
|
16
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
17
|
+
|
|
18
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
19
|
+
flag:
|
|
20
|
+
|
|
21
|
+
go test -bench .
|
|
22
|
+
|
|
23
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
24
|
+
different specs, so the results from these benchmark tests may vary.
|
|
25
|
+
|
|
26
|
+
## Further information
|
|
27
|
+
|
|
28
|
+
For more detailed information about the Go track, including how to get help if
|
|
29
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
30
|
+
|
|
31
|
+
## Source
|
|
32
|
+
|
|
33
|
+
Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)
|
|
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,71 @@
|
|
|
1
|
+
# Bowling
|
|
2
|
+
|
|
3
|
+
Score a bowling game.
|
|
4
|
+
|
|
5
|
+
Bowling is game where players roll a heavy ball to knock down pins
|
|
6
|
+
arranged in a triangle. Write code to keep track of the score
|
|
7
|
+
of a game of bowling.
|
|
8
|
+
|
|
9
|
+
## Scoring Bowling
|
|
10
|
+
|
|
11
|
+
The game consists of 10 frames. A frame is composed of one or two ball throws with 10 pins standing at frame initialization. There are three cases for the tabulation of a frame.
|
|
12
|
+
|
|
13
|
+
* An open frame is where a score of less than 10 is recorded for the frame. In this case the score for the frame is the number of pins knocked down.
|
|
14
|
+
|
|
15
|
+
* A spare is where all ten pins are knocked down after the second throw. The total value of a spare is 10 plus the number of pins knocked down in their next throw.
|
|
16
|
+
|
|
17
|
+
* A strike is where all ten pins are knocked down after the first throw. The total value of a strike is 10 plus the number of pins knocked down in their next two throws. If a strike is immediately followed by a second strike, then we can not total the value of first strike until they throw the ball one more time.
|
|
18
|
+
|
|
19
|
+
Here is a three frame example:
|
|
20
|
+
|
|
21
|
+
| Frame 1 | Frame 2 | Frame 3 |
|
|
22
|
+
| :-------------: |:-------------:| :---------------------:|
|
|
23
|
+
| X (strike) | 5/ (spare) | 9 0 (open frame) |
|
|
24
|
+
|
|
25
|
+
Frame 1 is (10 + 5 + 5) = 20
|
|
26
|
+
|
|
27
|
+
Frame 2 is (5 + 5 + 9) = 19
|
|
28
|
+
|
|
29
|
+
Frame 3 is (9 + 0) = 9
|
|
30
|
+
|
|
31
|
+
This means the current running total is 48.
|
|
32
|
+
|
|
33
|
+
The tenth frame in the game is a special case. If someone throws a strike or a spare then they get a fill ball. Fill balls exist to calculate the total of the 10th frame. Scoring a strike or spare on the fill ball does not give the player more fill balls. The total value of the 10th frame is the total number of pins knocked down.
|
|
34
|
+
|
|
35
|
+
For a tenth frame of X1/ (strike and a spare), the total value is 20.
|
|
36
|
+
|
|
37
|
+
For a tenth frame of XXX (three strikes), the total value is 30.
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
Write code to keep track of the score of a game of bowling. It should
|
|
42
|
+
support two operations:
|
|
43
|
+
|
|
44
|
+
* `roll(pins : int)` is called each time the player rolls a ball. The
|
|
45
|
+
argument is the number of pins knocked down.
|
|
46
|
+
* `score() : int` is called only at the very end of the game. It
|
|
47
|
+
returns the total score for that game.
|
|
48
|
+
|
|
49
|
+
## Running the tests
|
|
50
|
+
|
|
51
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
52
|
+
|
|
53
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
54
|
+
flag:
|
|
55
|
+
|
|
56
|
+
go test -bench .
|
|
57
|
+
|
|
58
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
59
|
+
different specs, so the results from these benchmark tests may vary.
|
|
60
|
+
|
|
61
|
+
## Further information
|
|
62
|
+
|
|
63
|
+
For more detailed information about the Go track, including how to get help if
|
|
64
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
65
|
+
|
|
66
|
+
## Source
|
|
67
|
+
|
|
68
|
+
The Bowling Game Kata at but UncleBob [http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata](http://butunclebob.com/ArticleS.UncleBob.TheBowlingGameKata)
|
|
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,28 @@
|
|
|
1
|
+
# Bracket Push
|
|
2
|
+
|
|
3
|
+
Given a string containing brackets `[]`, braces `{}` and parentheses `()`,
|
|
4
|
+
verify that all the pairs are matched and nested correctly.
|
|
5
|
+
|
|
6
|
+
## Running the tests
|
|
7
|
+
|
|
8
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
9
|
+
|
|
10
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
11
|
+
flag:
|
|
12
|
+
|
|
13
|
+
go test -bench .
|
|
14
|
+
|
|
15
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
16
|
+
different specs, so the results from these benchmark tests may vary.
|
|
17
|
+
|
|
18
|
+
## Further information
|
|
19
|
+
|
|
20
|
+
For more detailed information about the Go track, including how to get help if
|
|
21
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
22
|
+
|
|
23
|
+
## Source
|
|
24
|
+
|
|
25
|
+
Ginna Baker
|
|
26
|
+
|
|
27
|
+
## Submitting Incomplete Solutions
|
|
28
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Change
|
|
2
|
+
|
|
3
|
+
Correctly determine the fewest number of coins to be given to a customer such
|
|
4
|
+
that the sum of the coins' value would equal the correct amount of change.
|
|
5
|
+
|
|
6
|
+
## For example
|
|
7
|
+
|
|
8
|
+
- An input of 15 with [1, 5, 10, 25, 100] should return one nickel (5)
|
|
9
|
+
and one dime (10) or [0, 1, 1, 0, 0]
|
|
10
|
+
- An input of 40 with [1, 5, 10, 25, 100] should return one nickel (5)
|
|
11
|
+
and one dime (10) and one quarter (25) or [0, 1, 1, 1, 0]
|
|
12
|
+
|
|
13
|
+
## Edge cases
|
|
14
|
+
|
|
15
|
+
- Does your algorithm work for any given set of coins?
|
|
16
|
+
- Can you ask for negative change?
|
|
17
|
+
- Can you ask for a change value smaller than the smallest coin value?
|
|
18
|
+
|
|
19
|
+
## Running the tests
|
|
20
|
+
|
|
21
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
22
|
+
|
|
23
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
24
|
+
flag:
|
|
25
|
+
|
|
26
|
+
go test -bench .
|
|
27
|
+
|
|
28
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
29
|
+
different specs, so the results from these benchmark tests may vary.
|
|
30
|
+
|
|
31
|
+
## Further information
|
|
32
|
+
|
|
33
|
+
For more detailed information about the Go track, including how to get help if
|
|
34
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
35
|
+
|
|
36
|
+
## Source
|
|
37
|
+
|
|
38
|
+
Software Craftsmanship - Kata-logue [http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata](http://craftsmanship.sv.cmu.edu/exercises/coin-change-kata)
|
|
39
|
+
|
|
40
|
+
## Submitting Incomplete Solutions
|
|
41
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Circular Buffer
|
|
2
|
+
|
|
3
|
+
A circular buffer, cyclic buffer or ring buffer is a data structure that
|
|
4
|
+
uses a single, fixed-size buffer as if it were connected end-to-end.
|
|
5
|
+
|
|
6
|
+
A circular buffer first starts empty and of some predefined length. For
|
|
7
|
+
example, this is a 7-element buffer:
|
|
8
|
+
|
|
9
|
+
[ ][ ][ ][ ][ ][ ][ ]
|
|
10
|
+
|
|
11
|
+
Assume that a 1 is written into the middle of the buffer (exact starting
|
|
12
|
+
location does not matter in a circular buffer):
|
|
13
|
+
|
|
14
|
+
[ ][ ][ ][1][ ][ ][ ]
|
|
15
|
+
|
|
16
|
+
Then assume that two more elements are added — 2 & 3 — which get
|
|
17
|
+
appended after the 1:
|
|
18
|
+
|
|
19
|
+
[ ][ ][ ][1][2][3][ ]
|
|
20
|
+
|
|
21
|
+
If two elements are then removed from the buffer, the oldest values
|
|
22
|
+
inside the buffer are removed. The two elements removed, in this case,
|
|
23
|
+
are 1 & 2, leaving the buffer with just a 3:
|
|
24
|
+
|
|
25
|
+
[ ][ ][ ][ ][ ][3][ ]
|
|
26
|
+
|
|
27
|
+
If the buffer has 7 elements then it is completely full:
|
|
28
|
+
|
|
29
|
+
[6][7][8][9][3][4][5]
|
|
30
|
+
|
|
31
|
+
When the buffer is full an error will be raised, alerting the client
|
|
32
|
+
that further writes are blocked until a slot becomes free.
|
|
33
|
+
|
|
34
|
+
The client can opt to overwrite the oldest data with a forced write. In
|
|
35
|
+
this case, two more elements — A & B — are added and they overwrite the
|
|
36
|
+
3 & 4:
|
|
37
|
+
|
|
38
|
+
[6][7][8][9][A][B][5]
|
|
39
|
+
|
|
40
|
+
Finally, if two elements are now removed then what would be returned is
|
|
41
|
+
not 3 & 4 but 5 & 6 because A & B overwrote the 3 & the 4 yielding the
|
|
42
|
+
buffer with:
|
|
43
|
+
|
|
44
|
+
[ ][7][8][9][A][B][ ]
|
|
45
|
+
|
|
46
|
+
## Running the tests
|
|
47
|
+
|
|
48
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
49
|
+
|
|
50
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
51
|
+
flag:
|
|
52
|
+
|
|
53
|
+
go test -bench .
|
|
54
|
+
|
|
55
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
56
|
+
different specs, so the results from these benchmark tests may vary.
|
|
57
|
+
|
|
58
|
+
## Further information
|
|
59
|
+
|
|
60
|
+
For more detailed information about the Go track, including how to get help if
|
|
61
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
62
|
+
|
|
63
|
+
## Source
|
|
64
|
+
|
|
65
|
+
Wikipedia [http://en.wikipedia.org/wiki/Circular_buffer](http://en.wikipedia.org/wiki/Circular_buffer)
|
|
66
|
+
|
|
67
|
+
## Submitting Incomplete Solutions
|
|
68
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Clock
|
|
2
|
+
|
|
3
|
+
Implement a clock that handles times without dates.
|
|
4
|
+
|
|
5
|
+
You should be able to add and subtract minutes to it.
|
|
6
|
+
|
|
7
|
+
Two clocks that represent the same time should be equal to each other.
|
|
8
|
+
|
|
9
|
+
## Running the tests
|
|
10
|
+
|
|
11
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
12
|
+
|
|
13
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
14
|
+
flag:
|
|
15
|
+
|
|
16
|
+
go test -bench .
|
|
17
|
+
|
|
18
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
19
|
+
different specs, so the results from these benchmark tests may vary.
|
|
20
|
+
|
|
21
|
+
## Further information
|
|
22
|
+
|
|
23
|
+
For more detailed information about the Go track, including how to get help if
|
|
24
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
25
|
+
|
|
26
|
+
## Source
|
|
27
|
+
|
|
28
|
+
Pairing session with Erin Drummond [https://twitter.com/ebdrummond](https://twitter.com/ebdrummond)
|
|
29
|
+
|
|
30
|
+
## Submitting Incomplete Solutions
|
|
31
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Connect
|
|
2
|
+
|
|
3
|
+
Compute the result for a game of Hex / Polygon.
|
|
4
|
+
|
|
5
|
+
The abstract boardgame known as
|
|
6
|
+
[Hex](https://en.wikipedia.org/wiki/Hex_%28board_game%29) / Polygon /
|
|
7
|
+
CON-TAC-TIX is quite simple in rules, though complex in practice. Two players
|
|
8
|
+
place stones on a rhombus with hexagonal fields. The player to connect his/her
|
|
9
|
+
stones to the opposite side first wins. The four sides of the rhombus are
|
|
10
|
+
divided between the two players (i.e. one player gets assigned a side and the
|
|
11
|
+
side directly opposite it and the other player gets assigned the two other
|
|
12
|
+
sides).
|
|
13
|
+
|
|
14
|
+
Your goal is to build a program that given a simple representation of a board
|
|
15
|
+
computes the winner (or lack thereof). Note that all games need not be "fair".
|
|
16
|
+
(For example, players may have mismatched piece counts.)
|
|
17
|
+
|
|
18
|
+
The boards look like this (with spaces added for readability, which won't be in
|
|
19
|
+
the representation passed to your code):
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
. O . X .
|
|
23
|
+
. X X O .
|
|
24
|
+
O O O X .
|
|
25
|
+
. X O X O
|
|
26
|
+
X O O O X
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
"Player `O`" plays from top to bottom, "Player `X`" plays from left to right. In
|
|
30
|
+
the above example `O` has made a connection from left to right but nobody has
|
|
31
|
+
won since `O` didn't connect top and bottom.
|
|
32
|
+
|
|
33
|
+
## Running the tests
|
|
34
|
+
|
|
35
|
+
To run the tests run the command `go test` from within the exercise directory.
|
|
36
|
+
|
|
37
|
+
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
38
|
+
flag:
|
|
39
|
+
|
|
40
|
+
go test -bench .
|
|
41
|
+
|
|
42
|
+
Keep in mind that each reviewer will run benchmarks on a different machine, with
|
|
43
|
+
different specs, so the results from these benchmark tests may vary.
|
|
44
|
+
|
|
45
|
+
## Further information
|
|
46
|
+
|
|
47
|
+
For more detailed information about the Go track, including how to get help if
|
|
48
|
+
you're having trouble, please visit the exercism.io [Go language page](http://exercism.io/languages/go/about).
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
## Submitting Incomplete Solutions
|
|
52
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|