trackler 2.1.0.24 → 2.1.0.25
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/.gitmodules +3 -0
- data/CONTRIBUTING.md +5 -8
- data/README.md +7 -7
- data/common/CONTRIBUTING.md +0 -5
- data/common/exercises/accumulate/description.md +4 -1
- data/common/exercises/acronym/description.md +1 -1
- data/common/exercises/bank-account/description.md +2 -1
- data/common/exercises/book-store/description.md +2 -5
- data/common/exercises/bracket-push/description.md +2 -4
- data/common/exercises/change/description.md +2 -5
- data/common/exercises/circular-buffer/description.md +0 -2
- data/common/exercises/clock/description.md +0 -2
- data/common/exercises/collatz-conjecture/canonical-data.json +36 -0
- data/common/exercises/collatz-conjecture/description.md +25 -0
- data/common/exercises/collatz-conjecture/metadata.yml +4 -0
- data/common/exercises/counter/description.md +1 -2
- data/common/exercises/diamond/description.md +0 -4
- data/common/exercises/flatten-array/description.md +1 -1
- data/common/exercises/grade-school/description.md +2 -1
- data/common/exercises/grains/description.md +2 -1
- data/common/exercises/grep/description.md +3 -2
- data/common/exercises/kindergarten-garden/description.md +2 -1
- data/common/exercises/largest-series-product/description.md +2 -1
- data/common/exercises/matrix/description.md +2 -1
- data/common/exercises/nucleotide-codons/description.md +2 -1
- data/common/exercises/ocr-numbers/description.md +2 -1
- data/common/exercises/octal/description.md +3 -1
- data/common/exercises/pangram/description.md +2 -1
- data/common/exercises/perfect-numbers/description.md +2 -1
- data/common/exercises/poker/description.md +0 -2
- data/common/exercises/protein-translation/description.md +3 -2
- data/common/exercises/proverb/description.md +2 -1
- data/common/exercises/pythagorean-triplet/description.md +4 -2
- data/common/exercises/queen-attack/description.md +2 -1
- data/common/exercises/rectangles/description.md +1 -3
- data/common/exercises/rotational-cipher/description.md +0 -4
- data/common/exercises/scale-generator/description.md +0 -2
- data/common/exercises/secret-handshake/description.md +2 -2
- data/common/exercises/series/description.md +2 -1
- data/common/exercises/sieve/description.md +2 -1
- data/common/exercises/space-age/description.md +0 -2
- data/common/exercises/strain/description.md +4 -5
- data/common/exercises/sublist/description.md +3 -6
- data/common/exercises/sum-of-multiples/description.md +2 -1
- data/common/exercises/tournament/description.md +4 -3
- data/common/exercises/transpose/description.md +1 -3
- data/common/exercises/trinary/description.md +2 -1
- data/common/exercises/two-bucket/description.md +1 -3
- data/common/exercises/two-fer/canonical-data.json +24 -0
- data/common/exercises/two-fer/description.md +40 -0
- data/common/exercises/two-fer/metadata.yml +4 -0
- data/common/exercises/word-search/description.md +2 -4
- data/common/exercises/zebra-puzzle/description.md +1 -1
- data/lib/trackler.rb +10 -5
- data/lib/trackler/description.rb +2 -2
- data/lib/trackler/guaranteed_file.rb +15 -15
- data/lib/trackler/implementation.rb +5 -5
- data/lib/trackler/implementations.rb +2 -2
- data/lib/trackler/metadata.rb +2 -2
- data/lib/trackler/problem.rb +2 -96
- data/lib/trackler/problems.rb +3 -48
- data/lib/trackler/specification.rb +101 -0
- data/lib/trackler/specifications.rb +52 -0
- data/lib/trackler/track.rb +6 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/LICENSE +21 -0
- data/tracks/bash/README.md +0 -5
- data/tracks/c/LICENSE +21 -0
- data/tracks/c/README.md +0 -5
- data/tracks/clojure/LICENSE +2 -2
- data/tracks/clojure/README.org +0 -5
- data/tracks/clojure/config.json +5 -0
- data/tracks/clojure/exercises/sublist/project.clj +4 -0
- data/tracks/clojure/exercises/sublist/src/example.clj +19 -0
- data/tracks/clojure/exercises/sublist/sublist.mustache +9 -0
- data/tracks/clojure/exercises/sublist/test/sublist_test.clj +40 -0
- data/tracks/cpp/LICENSE +2 -2
- data/tracks/cpp/README.md +0 -5
- data/tracks/csharp/LICENSE +2 -2
- data/tracks/csharp/README.md +0 -5
- data/tracks/delphi/LICENSE +2 -2
- data/tracks/delphi/README.md +0 -5
- data/tracks/ecmascript/LICENSE +2 -2
- data/tracks/ecmascript/README.md +0 -5
- data/tracks/elisp/.travis.yml +7 -3
- data/tracks/elisp/LICENSE +2 -2
- data/tracks/elisp/README.org +3 -6
- data/tracks/elisp/bin/test-examples +27 -0
- data/tracks/elisp/config.json +10 -0
- data/tracks/elisp/docs/LEARNING.org +0 -3
- data/tracks/elisp/exercises/grains/example.el +18 -0
- data/tracks/elisp/exercises/grains/grains-test.el +38 -0
- data/tracks/elisp/exercises/grains/grains.el +10 -0
- data/tracks/elisp/exercises/phone-number/example.el +34 -0
- data/tracks/elisp/exercises/phone-number/phone-number-test.el +43 -0
- data/tracks/elisp/exercises/phone-number/phone-number.el +9 -0
- data/tracks/elixir/LICENSE +2 -2
- data/tracks/elixir/README.md +0 -5
- data/tracks/elm/LICENSE +2 -2
- data/tracks/elm/README.md +0 -5
- data/tracks/erlang/LICENSE +2 -2
- data/tracks/erlang/README.md +0 -5
- data/tracks/erlang/SETUP.md +7 -0
- data/tracks/erlang/exercises/rotational-cipher/rebar.config +5 -5
- data/tracks/erlang/exercises/rotational-cipher/test/rotational_cipher_tests.erl +18 -18
- data/tracks/factor/LICENSE +2 -2
- data/tracks/fortran/.github/PULL_REQUEST_TEMPLATE.md +23 -0
- data/tracks/fortran/.gitignore +4 -0
- data/tracks/fortran/.travis.yml +17 -0
- data/tracks/fortran/LICENSE +21 -0
- data/tracks/fortran/Makefile +40 -0
- data/tracks/fortran/README.md +72 -0
- data/tracks/fortran/bin/fetch-configlet +32 -0
- data/tracks/fortran/config.json +32 -0
- data/tracks/{kotlin/SETUP.md → fortran/docs/ABOUT.md} +0 -0
- data/tracks/fortran/docs/INSTALLATION.md +0 -0
- data/tracks/fortran/docs/LEARNING.md +0 -0
- data/tracks/fortran/docs/RESOURCES.md +0 -0
- data/tracks/fortran/docs/TESTS.md +0 -0
- data/tracks/fortran/exercises/TRACK_HINTS.md +0 -0
- data/tracks/fortran/exercises/bob/bob.fun +114 -0
- data/tracks/fortran/exercises/bob/example.f90 +61 -0
- data/tracks/fortran/exercises/hello_world/example.f90 +9 -0
- data/tracks/fortran/exercises/hello_world/hello_world.fun +10 -0
- data/tracks/fortran/img/.keep +0 -0
- data/tracks/fsharp/LICENSE +2 -2
- data/tracks/fsharp/README.md +0 -5
- data/tracks/go/LICENSE +2 -2
- data/tracks/go/README.md +0 -5
- data/tracks/haskell/LICENSE +2 -2
- data/tracks/haskell/README.md +0 -5
- data/tracks/idris/LICENSE +2 -2
- data/tracks/idris/README.md +0 -5
- data/tracks/java/LICENSE +2 -2
- data/tracks/java/README.md +0 -7
- data/tracks/java/{SETUP.md → TRACK_HINTS.md} +0 -0
- data/tracks/java/config.json +5 -0
- data/tracks/java/exercises/_template/build.gradle +1 -0
- data/tracks/java/exercises/accumulate/build.gradle +1 -0
- data/tracks/java/exercises/acronym/build.gradle +1 -0
- data/tracks/java/exercises/all-your-base/build.gradle +1 -0
- data/tracks/java/exercises/allergies/build.gradle +1 -0
- data/tracks/java/exercises/anagram/build.gradle +1 -0
- data/tracks/java/exercises/atbash-cipher/build.gradle +1 -0
- data/tracks/java/exercises/beer-song/build.gradle +1 -0
- data/tracks/java/exercises/binary-search/build.gradle +1 -0
- data/tracks/java/exercises/binary/build.gradle +1 -0
- data/tracks/java/exercises/bob/build.gradle +1 -0
- data/tracks/java/exercises/book-store/build.gradle +1 -0
- data/tracks/java/exercises/bracket-push/build.gradle +1 -0
- data/tracks/java/exercises/change/build.gradle +1 -0
- data/tracks/java/exercises/clock/build.gradle +2 -1
- data/tracks/java/exercises/collatz-conjecture/build.gradle +18 -0
- data/tracks/java/exercises/collatz-conjecture/src/example/java/CollatzCalculator.java +19 -0
- data/tracks/java/exercises/collatz-conjecture/src/main/java/CollatzCalculator.java +7 -0
- data/tracks/java/exercises/collatz-conjecture/src/test/java/CollatzCalculatorTest.java +59 -0
- data/tracks/java/exercises/crypto-square/build.gradle +1 -0
- data/tracks/java/exercises/diamond/build.gradle +1 -0
- data/tracks/java/exercises/diamond/src/example/java/DiamondPrinter.java +4 -4
- data/tracks/java/exercises/diamond/src/test/java/DiamondPrinterTest.java +6 -2
- data/tracks/java/exercises/difference-of-squares/build.gradle +1 -0
- data/tracks/java/exercises/difference-of-squares/src/main/java/.keep +0 -0
- data/tracks/java/exercises/etl/build.gradle +1 -0
- data/tracks/java/exercises/flatten-array/build.gradle +1 -0
- data/tracks/java/exercises/gigasecond/build.gradle +1 -0
- data/tracks/java/exercises/grade-school/build.gradle +1 -0
- data/tracks/java/exercises/hamming/build.gradle +1 -0
- data/tracks/java/exercises/hexadecimal/build.gradle +1 -0
- data/tracks/java/exercises/isogram/build.gradle +1 -0
- data/tracks/java/exercises/kindergarten-garden/build.gradle +1 -0
- data/tracks/java/exercises/largest-series-product/build.gradle +1 -0
- data/tracks/java/exercises/linked-list/build.gradle +1 -0
- data/tracks/java/exercises/luhn/build.gradle +1 -0
- data/tracks/java/exercises/matrix/build.gradle +2 -1
- data/tracks/java/exercises/meetup/build.gradle +1 -0
- data/tracks/java/exercises/minesweeper/build.gradle +1 -0
- data/tracks/java/exercises/nth-prime/build.gradle +1 -0
- data/tracks/java/exercises/ocr-numbers/build.gradle +1 -0
- data/tracks/java/exercises/octal/build.gradle +1 -0
- data/tracks/java/exercises/pangram/build.gradle +1 -0
- data/tracks/java/exercises/pascals-triangle/build.gradle +1 -0
- data/tracks/java/exercises/perfect-numbers/build.gradle +1 -0
- data/tracks/java/exercises/phone-number/build.gradle +1 -0
- data/tracks/java/exercises/pig-latin/build.gradle +1 -0
- data/tracks/java/exercises/queen-attack/build.gradle +1 -0
- data/tracks/java/exercises/raindrops/build.gradle +1 -0
- data/tracks/java/exercises/rectangles/build.gradle +1 -0
- data/tracks/java/exercises/rna-transcription/build.gradle +1 -0
- data/tracks/java/exercises/robot-simulator/build.gradle +1 -0
- data/tracks/java/exercises/roman-numerals/build.gradle +1 -0
- data/tracks/java/exercises/run-length-encoding/build.gradle +1 -0
- data/tracks/java/exercises/saddle-points/build.gradle +1 -0
- data/tracks/java/exercises/scrabble-score/build.gradle +1 -0
- data/tracks/java/exercises/secret-handshake/build.gradle +1 -0
- data/tracks/java/exercises/series/build.gradle +1 -0
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/sieve/build.gradle +1 -0
- data/tracks/java/exercises/simple-cipher/build.gradle +1 -0
- data/tracks/java/exercises/simple-linked-list/build.gradle +1 -0
- data/tracks/java/exercises/space-age/build.gradle +1 -0
- data/tracks/java/exercises/strain/build.gradle +1 -0
- data/tracks/java/exercises/sublist/build.gradle +1 -0
- data/tracks/java/exercises/sum-of-multiples/build.gradle +1 -0
- data/tracks/java/exercises/triangle/build.gradle +1 -0
- data/tracks/java/exercises/trinary/build.gradle +1 -0
- data/tracks/java/exercises/twelve-days/build.gradle +2 -1
- data/tracks/java/exercises/word-count/build.gradle +1 -0
- data/tracks/java/exercises/wordy/build.gradle +1 -0
- data/tracks/javascript/LICENSE +2 -2
- data/tracks/javascript/README.md +0 -5
- data/tracks/julia/LICENSE +2 -2
- data/tracks/kotlin/LICENSE +2 -2
- data/tracks/kotlin/README.md +0 -7
- data/tracks/kotlin/TRACK_HINTS.md +1 -0
- data/tracks/kotlin/exercises/phone-number/src/example/kotlin/PhoneNumber.kt +1 -1
- data/tracks/kotlin/exercises/phone-number/src/test/kotlin/PhoneNumberTest.kt +7 -8
- data/tracks/kotlin/exercises/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt +6 -6
- data/tracks/lfe/LICENSE +2 -2
- data/tracks/lfe/README.md +0 -5
- data/tracks/lisp/LICENSE +2 -2
- data/tracks/lisp/README.md +0 -5
- data/tracks/lua/LICENSE +2 -2
- data/tracks/lua/README.md +0 -5
- data/tracks/mips/LICENSE +2 -2
- data/tracks/mips/README.md +0 -5
- data/tracks/objective-c/LICENSE +2 -2
- data/tracks/objective-c/README.md +0 -5
- data/tracks/ocaml/LICENSE +2 -2
- data/tracks/ocaml/README.md +0 -5
- data/tracks/ocaml/config.json +54 -25
- data/tracks/ocaml/exercises/forth/.merlin +5 -0
- data/tracks/ocaml/exercises/forth/Makefile +11 -0
- data/tracks/ocaml/exercises/forth/example.ml +89 -0
- data/tracks/ocaml/exercises/forth/forth.mli +1 -0
- data/tracks/ocaml/exercises/forth/test.ml +147 -0
- data/tracks/ocaml/exercises/react/.merlin +5 -0
- data/tracks/ocaml/exercises/react/HINT.md +3 -0
- data/tracks/ocaml/exercises/react/Makefile +11 -0
- data/tracks/ocaml/exercises/react/example.ml +106 -0
- data/tracks/ocaml/exercises/react/react.mli +26 -0
- data/tracks/ocaml/exercises/react/test.ml +157 -0
- data/tracks/ocaml/tools/test-generator/src/special_cases.ml +5 -2
- data/tracks/ocaml/tools/test-generator/templates/forth/template.ml +114 -0
- data/tracks/perl5/LICENSE +2 -2
- data/tracks/perl6/LICENSE +2 -2
- data/tracks/perl6/README.md +0 -5
- data/tracks/perl6/config.json +5 -0
- data/tracks/perl6/exercises/clock/Example.pm6 +2 -2
- data/tracks/perl6/exercises/flatten-array/Example.pm6 +13 -0
- data/tracks/perl6/exercises/flatten-array/FlattenArray.pm6 +4 -0
- data/tracks/perl6/exercises/flatten-array/example.yaml +6 -0
- data/tracks/perl6/exercises/flatten-array/flatten-array.t +80 -0
- data/tracks/php/LICENSE +2 -2
- data/tracks/php/README.md +0 -5
- data/tracks/powershell/.travis.yml +1 -0
- data/tracks/python/LICENSE +2 -2
- data/tracks/python/README.md +0 -5
- data/tracks/python/config.json +8 -0
- data/tracks/python/exercises/protein-translation/example.py +25 -0
- data/tracks/python/exercises/protein-translation/protein_translation.py +6 -0
- data/tracks/python/exercises/protein-translation/protein_translation_test.py +59 -0
- data/tracks/r/LICENSE +2 -2
- data/tracks/r/README.md +0 -5
- data/tracks/racket/LICENSE +2 -2
- data/tracks/racket/README.md +0 -5
- data/tracks/racket/config.json +5 -0
- data/tracks/racket/exercises/acronym/acronym-test.rkt +40 -0
- data/tracks/racket/exercises/acronym/acronym.rkt +3 -0
- data/tracks/racket/exercises/acronym/example.rkt +25 -0
- data/tracks/racket/exercises/grep/example.rkt +60 -26
- data/tracks/racket/exercises/grep/grep-test.rkt +154 -17
- data/tracks/racket/exercises/grep/grep.rkt +1 -18
- data/tracks/racket/exercises/grep/iliad.txt +9 -0
- data/tracks/racket/exercises/grep/midsummer-night.txt +7 -0
- data/tracks/racket/exercises/grep/paradise-lost.txt +8 -0
- data/tracks/ruby/README.md +4 -1
- data/tracks/ruby/exercises/acronym/.meta/.version +1 -1
- data/tracks/ruby/exercises/acronym/.meta/solutions/acronym.rb +1 -1
- data/tracks/ruby/exercises/acronym/acronym_test.rb +2 -7
- data/tracks/ruby/exercises/anagram/.meta/generator/anagram_case.rb +1 -1
- data/tracks/ruby/exercises/beer-song/.meta/generator/beer_song_case.rb +1 -1
- data/tracks/ruby/exercises/clock/.meta/generator/clock_case.rb +1 -1
- data/tracks/ruby/exercises/connect/.meta/generator/connect_case.rb +0 -3
- data/tracks/ruby/exercises/connect/.meta/generator/test_template.erb +1 -1
- data/tracks/ruby/exercises/difference-of-squares/.meta/.version +1 -1
- data/tracks/ruby/exercises/difference-of-squares/.meta/solutions/difference_of_squares.rb +1 -1
- data/tracks/ruby/exercises/difference-of-squares/difference_of_squares_test.rb +12 -17
- data/tracks/ruby/exercises/triangle/.meta/generator/triangle_case.rb +10 -2
- data/tracks/ruby/exercises/triangle/triangle_test.rb +17 -17
- data/tracks/ruby/exercises/wordy/.meta/generator/wordy_case.rb +1 -1
- data/tracks/ruby/lib/generator/case_values.rb +1 -1
- data/tracks/ruby/lib/generator/exercise_case.rb +16 -2
- data/tracks/ruby/lib/generator/exercise_case/assertion.rb +4 -4
- data/tracks/ruby/test/fixtures/xruby/exercises/alpha/.meta/generator/alpha_case.rb +1 -1
- data/tracks/ruby/test/generator/case_values_test.rb +28 -7
- data/tracks/ruby/test/generator/exercise_case/assertion_test.rb +7 -7
- data/tracks/ruby/test/generator/exercise_case_test.rb +21 -25
- data/tracks/ruby/test/wordy_cases_test.rb +4 -4
- data/tracks/rust/LICENSE +2 -2
- data/tracks/rust/README.md +0 -5
- data/tracks/rust/config.json +1 -0
- data/tracks/rust/exercises/etl/Cargo.toml +1 -1
- data/tracks/rust/exercises/etl/example.rs +2 -2
- data/tracks/rust/exercises/etl/tests/etl.rs +26 -32
- data/tracks/rust/exercises/forth/tests/forth.rs +20 -22
- data/tracks/rust/exercises/minesweeper/Cargo.toml +1 -1
- data/tracks/rust/exercises/minesweeper/example.rs +3 -0
- data/tracks/rust/exercises/minesweeper/tests/minesweeper.rs +44 -46
- data/tracks/rust/exercises/raindrops/Cargo.toml +1 -1
- data/tracks/rust/exercises/raindrops/tests/raindrops.rs +12 -0
- data/tracks/rust/exercises/rna-transcription/Cargo.toml +1 -1
- data/tracks/rust/exercises/rna-transcription/example.rs +13 -9
- data/tracks/rust/exercises/rna-transcription/tests/rna-transcription.rs +23 -5
- data/tracks/scala/LICENSE +2 -2
- data/tracks/scala/README.md +0 -5
- data/tracks/scheme/LICENSE +2 -2
- data/tracks/scheme/README.org +0 -6
- data/tracks/swift/Dangerfile +1 -1
- data/tracks/swift/LICENSE +2 -2
- data/tracks/swift/README.md +0 -6
- data/tracks/vbnet/.travis.yml +1 -0
- data/tracks/vimscript/.travis.yml +4 -0
- data/tracks/vimscript/.vintrc.yaml +5 -0
- data/tracks/vimscript/TRACK_HINTS.md +19 -1
- data/tracks/vimscript/bin/pre-push +18 -0
- data/tracks/vimscript/config.json +8 -1
- data/tracks/vimscript/docs/ABOUT.md +7 -6
- data/tracks/vimscript/docs/TESTS.md +4 -4
- data/tracks/vimscript/exercises/allergies/allergies.vader +68 -0
- data/tracks/vimscript/exercises/allergies/allergies.vim +29 -0
- data/tracks/vimscript/exercises/allergies/example.vim +23 -0
- data/tracks/vimscript/lib/generate.vim +89 -0
- metadata +81 -6
- data/tracks/java/exercises/difference-of-squares/src/main/java/DifferenceOfSquaresCalculator.java +0 -15
- data/tracks/ocaml/.vscode/launch.json +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8e992178474e75584ead434f6949b980b992ed45
|
|
4
|
+
data.tar.gz: d6b4cbd00de3ee42f96e025937e18154edfab66e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67568e6b9ef2079e4f16e767c01c147d664b12a3629196b517c12f74a9124a5d82e2c214623153ab0b59d9b26b60d96218d46eea64dcaaef693f49c8c62c043b
|
|
7
|
+
data.tar.gz: 2ac45474dfdfda50caa53c35dfccb94b9ec5947cd77570fb82ac9d159c95a9efc1bfe381178c6c2055a5869a91b85e1f05b7e0830d2a2eeafc241fccefa6b812
|
data/.gitmodules
CHANGED
data/CONTRIBUTING.md
CHANGED
|
@@ -10,17 +10,12 @@ A git submodule is essentially a project in another project.
|
|
|
10
10
|
|
|
11
11
|
## Terminology
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* _Track ID_ - a url-friendly version of the language name, e.g. `cpp`.
|
|
16
|
-
* _Problem_ - a high-level, language-independent description of a problem to solve.
|
|
17
|
-
* _Implementation_ - a language-specific implementation of a problem. This contains at
|
|
18
|
-
minimum a README and a test suite.
|
|
13
|
+
Check out the [glossary][] for an overview of the important terms for Exercism, many
|
|
14
|
+
of which are used as class names in this codebase.
|
|
19
15
|
|
|
20
16
|
## Adding a New Language Track
|
|
21
17
|
|
|
22
|
-
To start a new language track,
|
|
23
|
-
repository for you.
|
|
18
|
+
To start a new language track, open an issue in the [request-new-language-track][] repository.
|
|
24
19
|
|
|
25
20
|
Once the repository exists, it can be added as a submodule here (using C++ as an example):
|
|
26
21
|
|
|
@@ -31,3 +26,5 @@ $ TRACK_ID=cpp; git submodule add https://github.com/exercism/x$TRACK_ID.git tra
|
|
|
31
26
|
[submodule]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
|
|
32
27
|
[xtracks]: https://github.com/exercism/trackler/tree/master/tracks
|
|
33
28
|
[xcommon]: https://github.com/exercism/x-common
|
|
29
|
+
[glossary]: https://github.com/exercism/docs/blob/master/glossary.md
|
|
30
|
+
[request-new-language-track]: https://github.com/exercism/request-new-language-track
|
data/README.md
CHANGED
|
@@ -36,26 +36,26 @@ track.implementations.each do |implementation|
|
|
|
36
36
|
end
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
To get a problem, use the
|
|
39
|
+
To get the specification of a problem, use the exercise slug:
|
|
40
40
|
|
|
41
41
|
```
|
|
42
|
-
|
|
42
|
+
specification = Trackler.specifications["leap"]
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
Specifications contain the generic, language-independent metadata:
|
|
46
46
|
|
|
47
47
|
```
|
|
48
|
-
|
|
48
|
+
specification.blurb
|
|
49
49
|
# => "Write a program that will take a year and report if it is a leap year."
|
|
50
|
-
|
|
50
|
+
specification.name
|
|
51
51
|
# => "Leap"
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
You can get all of the different language implementations for a
|
|
54
|
+
You can get all of the different language implementations for a specification:
|
|
55
55
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
|
-
Trackler.implementations[
|
|
58
|
+
Trackler.implementations[specification.slug].each do |implementation|
|
|
59
59
|
# ...
|
|
60
60
|
end
|
|
61
61
|
```
|
data/common/CONTRIBUTING.md
CHANGED
|
@@ -32,7 +32,6 @@ themselves. There are other guides about contributing to other parts of the Exer
|
|
|
32
32
|
* [Providing Feedback on the Site for an Exercise You Implemented](#providing-feedback-on-the-site-for-an-exercise-you-implemented)
|
|
33
33
|
* [Implementing a Completely New Exercise](#implementing-a-completely-new-exercise)
|
|
34
34
|
* [Improving Consistency By Extracting Shared Test Data](#improving-consistency-by-extracting-shared-test-data)
|
|
35
|
-
* [Writing a New Test Suite Generator](#writing-a-new-test-suite-generator)
|
|
36
35
|
* [Track Anatomy](#track-anatomy)
|
|
37
36
|
* [Starting a New Track](#starting-a-new-track)
|
|
38
37
|
* [Beta-Testing a Language Track](#beta-testing-a-language-track)
|
|
@@ -404,10 +403,6 @@ From what you learned in step 3 decide for a sensible set of test cases. The fol
|
|
|
404
403
|
|
|
405
404
|
If you are unsure about all these considerations just make a pull request with an initial proposal and ask the community for help.
|
|
406
405
|
|
|
407
|
-
## Writing a New Test Suite Generator
|
|
408
|
-
|
|
409
|
-
TODO: elaborate.
|
|
410
|
-
|
|
411
406
|
## Track Anatomy
|
|
412
407
|
|
|
413
408
|
Each track should have the following structure:
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
Implement the `accumulate` operation, which, given a collection and an
|
|
1
|
+
Implement the `accumulate` operation, which, given a collection and an
|
|
2
|
+
operation to perform on each element of the collection, returns a new
|
|
3
|
+
collection containing the result of applying that operation to each element of
|
|
4
|
+
the input collection.
|
|
2
5
|
|
|
3
6
|
Given the collection of numbers:
|
|
4
7
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Simulate a bank account supporting opening/closing,
|
|
1
|
+
Simulate a bank account supporting opening/closing, withdrawals, and deposits
|
|
2
|
+
of money. Watch out for concurrent transactions!
|
|
2
3
|
|
|
3
4
|
A bank account can be accessed in multiple ways. Clients can make
|
|
4
5
|
deposits and withdrawals using the internet, mobile phones, etc. Shops
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
To try and encourage more sales of different books from a popular 5 book
|
|
2
|
-
|
|
3
|
-
To try and encourage more sales of the 5 different books
|
|
4
|
-
they sell of a popular series, a bookshop has decided to
|
|
5
|
-
offer discounts of multi-book purchases.
|
|
1
|
+
To try and encourage more sales of different books from a popular 5 book
|
|
2
|
+
series, a bookshop has decided to offer discounts on multiple book purchases.
|
|
6
3
|
|
|
7
4
|
One copy of any of the five books costs $8.
|
|
8
5
|
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Ensure that all the brackets and braces are matched correctly,
|
|
4
|
-
and nested correctly.
|
|
1
|
+
Given a string containing brackets `[]`, braces `{}` and parentheses `()`,
|
|
2
|
+
verify that all the pairs are matched and nested correctly.
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
Correctly determine
|
|
2
|
-
|
|
3
|
-
Correctly determine the fewest number of coins to be given to the user
|
|
4
|
-
such that the sum of the coins' value would equal the correct amount
|
|
5
|
-
of change.
|
|
1
|
+
Correctly determine the fewest number of coins to be given to a customer such
|
|
2
|
+
that the sum of the coins' value would equal the correct amount of change.
|
|
6
3
|
|
|
7
4
|
## For example
|
|
8
5
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"exercise": "collatz-conjecture",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"cases": [
|
|
5
|
+
{
|
|
6
|
+
"description": "zero steps for one",
|
|
7
|
+
"property": "steps",
|
|
8
|
+
"number": 1,
|
|
9
|
+
"expected": 0
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"description": "divide if even",
|
|
13
|
+
"property": "steps",
|
|
14
|
+
"number": 16,
|
|
15
|
+
"expected": 4
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"description": "even and odd steps",
|
|
19
|
+
"property": "steps",
|
|
20
|
+
"number": 12,
|
|
21
|
+
"expected": 9
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"description": "zero is an error",
|
|
25
|
+
"property": "steps",
|
|
26
|
+
"number": 0,
|
|
27
|
+
"expected": { "error": "Only positive numbers are allowed" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"description": "negative value is an error ",
|
|
31
|
+
"property": "steps",
|
|
32
|
+
"number": -15,
|
|
33
|
+
"expected": { "error": "Only positive numbers are allowed" }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
The Collatz Conjecture or 3x+1 problem can be summarized as follows:
|
|
2
|
+
|
|
3
|
+
Take any positive integer n. If n is even, divide n by 2 to get n / 2. If n is
|
|
4
|
+
odd, multiply n by 3 and add 1 to get 3n + 1. Repeat the process indefinitely.
|
|
5
|
+
The conjecture states that no matter which number you start with, you will
|
|
6
|
+
always reach 1 eventually.
|
|
7
|
+
|
|
8
|
+
Given a number n, return the number of steps required to reach 1.
|
|
9
|
+
|
|
10
|
+
## Examples
|
|
11
|
+
Starting with n = 12, the steps would be as follows:
|
|
12
|
+
|
|
13
|
+
0. 12
|
|
14
|
+
1. 6
|
|
15
|
+
2. 3
|
|
16
|
+
3. 10
|
|
17
|
+
4. 5
|
|
18
|
+
5. 16
|
|
19
|
+
6. 8
|
|
20
|
+
7. 4
|
|
21
|
+
8. 2
|
|
22
|
+
9. 1
|
|
23
|
+
|
|
24
|
+
Resulting in 9 steps. So for input n = 12, the return value would be 9.
|
|
25
|
+
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
Design a test suite for a line/letter/character counter tool.
|
|
2
|
-
|
|
3
1
|
**NOTE: This exercise has been deprecated.**
|
|
4
2
|
|
|
5
3
|
Please see the discussion in https://github.com/exercism/x-common/issues/80
|
|
6
4
|
for more context.
|
|
7
5
|
|
|
8
6
|
--------
|
|
7
|
+
Design a test suite for a line/letter/character counter tool.
|
|
9
8
|
|
|
10
9
|
This is a special exercise. Instead of creating code that works with
|
|
11
10
|
an existing test suite you get to define the test suite. To help you
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
Given a letter, print a diamond starting with 'A' with the supplied letter at the widest point.
|
|
2
|
-
|
|
3
|
-
## Diamond kata
|
|
4
|
-
|
|
5
1
|
The diamond kata takes as its input a letter, and outputs it in a diamond
|
|
6
2
|
shape. Given a letter, it prints a diamond starting with 'A', with the
|
|
7
3
|
supplied letter at the widest point.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Take a nested list and return a single list with all values except nil/null.
|
|
1
|
+
Take a nested list and return a single flattened list with all values except nil/null.
|
|
2
2
|
|
|
3
3
|
The challenge is to write a function that accepts an arbitrarily-deep nested list-like structure and returns a flattened structure without any nil/null values.
|
|
4
4
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Calculate the number of grains of wheat on a chessboard given that the number
|
|
1
|
+
Calculate the number of grains of wheat on a chessboard given that the number
|
|
2
|
+
on each square doubles.
|
|
2
3
|
|
|
3
4
|
There once was a wise servant who saved the life of a prince. The king
|
|
4
5
|
promised to pay whatever the servant could dream up. Knowing that the
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Search a file for lines matching a regular expression pattern. Return the line
|
|
1
|
+
Search a file for lines matching a regular expression pattern. Return the line
|
|
2
|
+
number and contents of each matching line.
|
|
2
3
|
|
|
3
4
|
The Unix [`grep`](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html) command can be used to search for lines in one or more files
|
|
4
5
|
that match a user-provided search query (known as the *pattern*).
|
|
@@ -59,4 +60,4 @@ hello again
|
|
|
59
60
|
The `grep` command should support multiple flags at once.
|
|
60
61
|
|
|
61
62
|
For example, running `grep -l -v "hello" file1.txt file2.txt` should
|
|
62
|
-
print the names of files that do not contain the string "hello".
|
|
63
|
+
print the names of files that do not contain the string "hello".
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Given a diagram, determine which plants each child in the kindergarten class is
|
|
1
|
+
Given a diagram, determine which plants each child in the kindergarten class is
|
|
2
|
+
responsible for.
|
|
2
3
|
|
|
3
4
|
The kindergarten class is learning about growing plants. The teachers
|
|
4
5
|
thought it would be a good idea to give them actual seeds, plant them in
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Given a string of digits, calculate the largest product for a contiguous
|
|
1
|
+
Given a string of digits, calculate the largest product for a contiguous
|
|
2
|
+
substring of digits of length n.
|
|
2
3
|
|
|
3
4
|
For example, for the input `'1027839564'`, the largest product for a
|
|
4
5
|
series of 3 digits is 270 (9 * 5 * 6), and the largest product for a
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Write a function that returns the name of an amino acid a particular codon,
|
|
1
|
+
Write a function that returns the name of an amino acid a particular codon,
|
|
2
|
+
possibly using shorthand, encodes for.
|
|
2
3
|
|
|
3
4
|
In DNA sequences of 3 nucleotides, called codons, encode for amino acids. Often
|
|
4
5
|
several codons encode for the same amino acid. The International Union of Pure
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
Convert
|
|
1
|
+
Convert an octal number, represented as a string (e.g. '1735263'), to its
|
|
2
|
+
decimal equivalent using first principles (i.e. no, you may not use built-in or
|
|
3
|
+
external libraries to accomplish the conversion).
|
|
2
4
|
|
|
3
5
|
Implement octal to decimal conversion. Given an octal input
|
|
4
6
|
string, your program should produce a decimal output.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma,
|
|
2
2
|
"every letter") is a sentence using every letter of the alphabet at least once.
|
|
3
|
-
The best known English pangram is
|
|
3
|
+
The best known English pangram is:
|
|
4
|
+
> The quick brown fox jumps over the lazy dog.
|
|
4
5
|
|
|
5
6
|
The alphabet used is ASCII, and case insensitive, from 'a' to 'z'
|
|
6
7
|
inclusively.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Determine if a number is perfect, abundant, or deficient based on
|
|
1
|
+
Determine if a number is perfect, abundant, or deficient based on
|
|
2
|
+
Nicomachus' (60 - 120 CE) classification scheme for natural numbers.
|
|
2
3
|
|
|
3
4
|
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
|
|
4
5
|
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
Translate RNA sequences into proteins.
|
|
2
2
|
|
|
3
|
-
Let's translate RNA sequences into proteins. [general ref](http://en.wikipedia.org/wiki/Translation_(biology))
|
|
4
|
-
|
|
5
3
|
RNA can be broken into three nucleotide sequences called codons, and then translated to a polypeptide like so:
|
|
6
4
|
|
|
7
5
|
RNA: `"AUGUUUUCU"` => translates to
|
|
@@ -38,3 +36,6 @@ UAU, UAC | Tyrosine
|
|
|
38
36
|
UGU, UGC | Cysteine
|
|
39
37
|
UGG | Tryptophan
|
|
40
38
|
UAA, UAG, UGA | STOP
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
Learn more about [protein translation on Wikipedia](http://en.wikipedia.org/wiki/Translation_(biology))
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
For want of a horseshoe nail, a kingdom was lost, or so the saying goes. Output
|
|
1
|
+
For want of a horseshoe nail, a kingdom was lost, or so the saying goes. Output
|
|
2
|
+
the full text of this proverbial rhyme.
|
|
2
3
|
|
|
3
4
|
For want of a nail the shoe was lost.
|
|
4
5
|
For want of a shoe the horse was lost.
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product a * b * c.
|
|
2
|
-
|
|
3
1
|
A Pythagorean triplet is a set of three natural numbers, {a, b, c}, for
|
|
4
2
|
which,
|
|
5
3
|
|
|
@@ -12,3 +10,7 @@ For example,
|
|
|
12
10
|
```
|
|
13
11
|
3**2 + 4**2 = 9 + 16 = 25 = 5**2.
|
|
14
12
|
```
|
|
13
|
+
|
|
14
|
+
There exists exactly one Pythagorean triplet for which a + b + c = 1000.
|
|
15
|
+
|
|
16
|
+
Find the product a * b * c.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
Given the position of two queens on a chess board, indicate whether or not they
|
|
1
|
+
Given the position of two queens on a chess board, indicate whether or not they
|
|
2
|
+
are positioned so that they can attack each other.
|
|
2
3
|
|
|
3
4
|
In the game of chess, a queen can attack pieces which are on the same
|
|
4
5
|
row, column, or diagonal.
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
Create an implementation of the rotational cipher, also sometimes called the Caesar cipher.
|
|
2
2
|
|
|
3
|
-
# Rotational Cipher
|
|
4
|
-
|
|
5
|
-
Create an implementation of the rotational cipher, also sometimes called the Caesar cipher.
|
|
6
|
-
|
|
7
3
|
The Caesar cipher is a simple shift cipher that relies on
|
|
8
4
|
transposing all the letters in the alphabet using an integer key
|
|
9
5
|
between `0` and `26`. Using a key of `0` or `26` will always yield
|