trackler 2.2.1.53 → 2.2.1.54
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/problem-specifications/exercises/nth-prime/canonical-data.json +2 -7
- data/problem-specifications/exercises/zebra-puzzle/canonical-data.json +16 -0
- data/tracks/c/config.json +11 -1
- data/tracks/c/docs/C_STYLE_GUIDE.md +142 -0
- data/tracks/c/exercises/collatz-conjecture/README.md +65 -0
- data/tracks/c/exercises/collatz-conjecture/makefile +15 -0
- data/tracks/c/exercises/collatz-conjecture/src/collatz_conjecture.h +8 -0
- data/tracks/c/exercises/collatz-conjecture/src/example.c +23 -0
- data/tracks/c/exercises/collatz-conjecture/test/test_collatz_conjecture.c +48 -0
- data/tracks/c/exercises/collatz-conjecture/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/collatz-conjecture/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/collatz-conjecture/test/vendor/unity_internals.h +701 -0
- data/tracks/cfml/tasks/GenerateReadme.cfc +5 -5
- data/tracks/erlang/testgen/src/testgen.erl +99 -17
- data/tracks/erlang/testgen/src/tg_file_tools.erl +3 -3
- data/tracks/erlang/testgen/src/tgen.erl +15 -7
- data/tracks/haskell/config.json +15 -3
- data/tracks/java/scripts/canonical_data_check.sh +1 -1
- data/tracks/javascript/config.json +12 -0
- data/tracks/javascript/exercises/difference-of-squares/README.md +1 -1
- data/tracks/javascript/exercises/sum-of-multiples/README.md +1 -1
- data/tracks/javascript/exercises/zipper/README.md +55 -0
- data/tracks/javascript/exercises/zipper/example.js +100 -0
- data/tracks/javascript/exercises/zipper/zipper.spec.js +77 -0
- data/tracks/julia/config.json +12 -0
- data/tracks/julia/exercises/triangle/README.md +30 -0
- data/tracks/julia/exercises/triangle/example.jl +25 -0
- data/tracks/julia/exercises/triangle/runtests.jl +64 -0
- data/tracks/julia/exercises/triangle/triangle.jl +8 -0
- data/tracks/kotlin/exercises/leap/.meta/version +1 -1
- data/tracks/kotlin/exercises/leap/src/test/kotlin/LeapTest.kt +1 -1
- data/tracks/kotlin/scripts/canonical_data_check.sh +1 -1
- data/tracks/perl6/bin/README.md +1 -4
- data/tracks/perl6/bin/exercise-gen.pl6 +3 -4
- data/tracks/perl6/exercises/accumulate/example.yaml +2 -2
- data/tracks/perl6/exercises/all-your-base/example.yaml +9 -9
- data/tracks/perl6/exercises/allergies/example.yaml +7 -7
- data/tracks/perl6/exercises/anagram/example.yaml +3 -3
- data/tracks/perl6/exercises/atbash-cipher/example.yaml +3 -3
- data/tracks/perl6/exercises/bob/example.yaml +4 -4
- data/tracks/perl6/exercises/clock/example.yaml +6 -6
- data/tracks/perl6/exercises/flatten-array/example.yaml +4 -4
- data/tracks/perl6/exercises/grade-school/example.yaml +6 -6
- data/tracks/perl6/exercises/grains/example.yaml +3 -3
- data/tracks/perl6/exercises/hello-world/example.yaml +5 -5
- data/tracks/perl6/exercises/leap/example.yaml +4 -4
- data/tracks/perl6/exercises/linked-list/example.yaml +14 -14
- data/tracks/perl6/exercises/luhn/example.yaml +3 -3
- data/tracks/perl6/exercises/phone-number/example.yaml +3 -3
- data/tracks/perl6/exercises/raindrops/example.yaml +3 -3
- data/tracks/perl6/exercises/rna-transcription/example.yaml +3 -3
- data/tracks/perl6/exercises/robot-name/example.yaml +8 -8
- data/tracks/perl6/exercises/scrabble-score/example.yaml +3 -3
- data/tracks/perl6/exercises/space-age/example.yaml +8 -8
- data/tracks/perl6/exercises/word-count/example.yaml +3 -3
- data/tracks/perl6/exercises/wordy/example.yaml +3 -3
- data/tracks/python/config.json +14 -0
- data/tracks/python/config/maintainers.json +30 -0
- data/tracks/python/docs/EXERCISE_README_INSERT.md +1 -2
- data/tracks/python/exercises/accumulate/README.md +1 -5
- data/tracks/python/exercises/acronym/README.md +1 -3
- data/tracks/python/exercises/all-your-base/README.md +2 -3
- data/tracks/python/exercises/all-your-base/all_your_base_test.py +13 -13
- data/tracks/python/exercises/allergies/README.md +1 -3
- data/tracks/python/exercises/alphametics/README.md +3 -4
- data/tracks/python/exercises/anagram/README.md +1 -2
- data/tracks/python/exercises/atbash-cipher/README.md +3 -3
- data/tracks/python/exercises/beer-song/README.md +2 -3
- data/tracks/python/exercises/binary-search/README.md +1 -2
- data/tracks/python/exercises/binary/README.md +3 -2
- data/tracks/python/exercises/bob/README.md +1 -2
- data/tracks/python/exercises/book-store/README.md +6 -7
- data/tracks/python/exercises/bracket-push/README.md +1 -2
- data/tracks/python/exercises/change/README.md +2 -3
- data/tracks/python/exercises/circular-buffer/README.md +14 -8
- data/tracks/python/exercises/clock/README.md +1 -2
- data/tracks/python/exercises/clock/clock_test.py +2 -0
- data/tracks/python/exercises/collatz-conjecture/.meta/hints.md +3 -0
- data/tracks/python/exercises/collatz-conjecture/README.md +6 -19
- data/tracks/python/exercises/complex-numbers/README.md +28 -2
- data/tracks/python/exercises/crypto-square/README.md +11 -10
- data/tracks/python/exercises/diamond/README.md +7 -8
- data/tracks/python/exercises/difference-of-squares/README.md +1 -2
- data/tracks/python/exercises/diffie-hellman/.meta/hints.md +1 -1
- data/tracks/python/exercises/diffie-hellman/README.md +3 -2
- data/tracks/python/exercises/error-handling/.meta/hints.md +8 -0
- data/tracks/python/exercises/error-handling/README.md +10 -2
- data/tracks/python/exercises/error-handling/error_handling_test.py +15 -3
- data/tracks/python/exercises/etl/README.md +3 -2
- data/tracks/python/exercises/flatten-array/README.md +2 -4
- data/tracks/python/exercises/food-chain/README.md +3 -4
- data/tracks/python/exercises/forth/README.md +2 -6
- data/tracks/python/exercises/gigasecond/README.md +1 -2
- data/tracks/python/exercises/grade-school/README.md +1 -3
- data/tracks/python/exercises/grains/README.md +1 -3
- data/tracks/python/exercises/grep/README.md +13 -14
- data/tracks/python/exercises/hamming/README.md +1 -2
- data/tracks/python/exercises/hamming/hamming_test.py +6 -6
- data/tracks/python/exercises/hello-world/README.md +1 -2
- data/tracks/python/exercises/hexadecimal/README.md +1 -2
- data/tracks/python/exercises/hexadecimal/example.py +6 -6
- data/tracks/python/exercises/house/README.md +2 -4
- data/tracks/python/exercises/isogram/README.md +3 -3
- data/tracks/python/exercises/kindergarten-garden/README.md +14 -15
- data/tracks/python/exercises/largest-series-product/README.md +1 -2
- data/tracks/python/exercises/leap/README.md +2 -3
- data/tracks/python/exercises/linked-list/README.md +11 -12
- data/tracks/python/exercises/list-ops/README.md +1 -2
- data/tracks/python/exercises/luhn/README.md +8 -9
- data/tracks/python/exercises/markdown/README.md +1 -6
- data/tracks/python/exercises/matrix/README.md +7 -6
- data/tracks/python/exercises/meetup/README.md +2 -4
- data/tracks/python/exercises/minesweeper/README.md +1 -2
- data/tracks/python/exercises/nth-prime/README.md +1 -2
- data/tracks/python/exercises/nucleotide-count/README.md +9 -24
- data/tracks/python/exercises/ocr-numbers/README.md +6 -7
- data/tracks/python/exercises/octal/README.md +7 -4
- data/tracks/python/exercises/palindrome-products/README.md +16 -18
- data/tracks/python/exercises/pangram/README.md +2 -3
- data/tracks/python/exercises/pascals-triangle/README.md +2 -3
- data/tracks/python/exercises/perfect-numbers/README.md +3 -4
- data/tracks/python/exercises/phone-number/README.md +4 -4
- data/tracks/python/exercises/pig-latin/README.md +1 -2
- data/tracks/python/exercises/point-mutations/README.md +1 -2
- data/tracks/python/exercises/poker/README.md +1 -2
- data/tracks/python/exercises/prime-factors/README.md +1 -2
- data/tracks/python/exercises/protein-translation/README.md +5 -7
- data/tracks/python/exercises/proverb/README.md +12 -11
- data/tracks/python/exercises/pythagorean-triplet/README.md +4 -5
- data/tracks/python/exercises/queen-attack/README.md +2 -3
- data/tracks/python/exercises/rail-fence-cipher/README.md +13 -9
- data/tracks/python/exercises/raindrops/README.md +1 -2
- data/tracks/python/exercises/rectangles/README.md +8 -9
- data/tracks/python/exercises/rectangles/example.py +3 -3
- data/tracks/python/exercises/rna-transcription/README.md +1 -2
- data/tracks/python/exercises/rna-transcription/rna_transcription_test.py +4 -3
- data/tracks/python/exercises/robot-name/README.md +1 -2
- data/tracks/python/exercises/robot-simulator/README.md +1 -2
- data/tracks/python/exercises/roman-numerals/README.md +2 -3
- data/tracks/python/exercises/rotational-cipher/README.md +3 -3
- data/tracks/python/exercises/run-length-encoding/README.md +5 -6
- data/tracks/python/exercises/run-length-encoding/example.py +2 -2
- data/tracks/python/exercises/saddle-points/README.md +2 -3
- data/tracks/python/exercises/say/README.md +1 -2
- data/tracks/python/exercises/scale-generator/README.md +1 -3
- data/tracks/python/exercises/scrabble-score/README.md +4 -3
- data/tracks/python/exercises/secret-handshake/README.md +2 -3
- data/tracks/python/exercises/series/README.md +1 -2
- data/tracks/python/exercises/sieve/README.md +1 -2
- data/tracks/python/exercises/simple-cipher/README.md +3 -4
- data/tracks/python/exercises/space-age/README.md +2 -3
- data/tracks/python/exercises/space-age/space_age_test.py +18 -29
- data/tracks/python/exercises/strain/README.md +1 -2
- data/tracks/python/exercises/sublist/README.md +1 -2
- data/tracks/python/exercises/sum-of-multiples/README.md +1 -5
- data/tracks/python/exercises/tournament/README.md +6 -7
- data/tracks/python/exercises/transpose/README.md +8 -9
- data/tracks/python/exercises/tree-building/README.md +25 -0
- data/tracks/python/exercises/tree-building/example.py +46 -0
- data/tracks/python/exercises/tree-building/tree_building.py +50 -0
- data/tracks/python/exercises/tree-building/tree_building_test.py +183 -0
- data/tracks/python/exercises/triangle/README.md +10 -8
- data/tracks/python/exercises/trinary/README.md +2 -3
- data/tracks/python/exercises/twelve-days/README.md +2 -3
- data/tracks/python/exercises/two-bucket/README.md +4 -5
- data/tracks/python/exercises/two-bucket/two_bucket_test.py +2 -0
- data/tracks/python/exercises/two-fer/README.md +4 -5
- data/tracks/python/exercises/two-fer/two_fer_test.py +5 -2
- data/tracks/python/exercises/variable-length-quantity/README.md +7 -9
- data/tracks/python/exercises/word-count/README.md +2 -4
- data/tracks/python/exercises/word-search/README.md +2 -3
- data/tracks/python/exercises/wordy/README.md +1 -7
- data/tracks/python/exercises/wordy/example.py +8 -8
- data/tracks/python/exercises/wordy/wordy_test.py +36 -32
- data/tracks/python/exercises/zebra-puzzle/README.md +1 -2
- data/tracks/python/requirements-travis.txt +1 -1
- data/tracks/ruby/config.json +11 -0
- data/tracks/ruby/docs/TESTS.md +6 -0
- data/tracks/ruby/exercises/pangram/.meta/.version +1 -1
- data/tracks/ruby/exercises/pangram/.meta/solutions/pangram.rb +1 -1
- data/tracks/ruby/exercises/pangram/pangram_test.rb +11 -4
- data/tracks/ruby/exercises/two-fer/.meta/.version +1 -0
- data/tracks/ruby/exercises/two-fer/.meta/generator/two_fer_case.rb +12 -0
- data/tracks/ruby/exercises/two-fer/.meta/solutions/two_fer.rb +9 -0
- data/tracks/ruby/exercises/two-fer/README.md +69 -0
- data/tracks/ruby/exercises/two-fer/two_fer_test.rb +42 -0
- data/tracks/rust/config.json +12 -0
- data/tracks/rust/exercises/binary-search/.meta/hints.md +38 -0
- data/tracks/rust/exercises/binary-search/Cargo.lock +4 -0
- data/tracks/rust/exercises/binary-search/Cargo.toml +6 -0
- data/tracks/rust/exercises/binary-search/README.md +113 -0
- data/tracks/rust/exercises/binary-search/example.rs +29 -0
- data/tracks/rust/exercises/binary-search/src/lib.rs +0 -0
- data/tracks/rust/exercises/binary-search/tests/binary-search.rs +96 -0
- data/tracks/typescript/common/package.json +6 -6
- data/tracks/typescript/common/yarn.lock +929 -610
- data/tracks/typescript/exercises/acronym/package.json +6 -6
- data/tracks/typescript/exercises/acronym/yarn.lock +929 -610
- data/tracks/typescript/exercises/anagram/package.json +6 -6
- data/tracks/typescript/exercises/anagram/yarn.lock +929 -610
- data/tracks/typescript/exercises/beer-song/package.json +6 -6
- data/tracks/typescript/exercises/beer-song/yarn.lock +929 -610
- data/tracks/typescript/exercises/binary-search-tree/package.json +6 -6
- data/tracks/typescript/exercises/binary-search-tree/yarn.lock +929 -610
- data/tracks/typescript/exercises/binary-search/package.json +6 -6
- data/tracks/typescript/exercises/binary-search/yarn.lock +929 -610
- data/tracks/typescript/exercises/bob/package.json +6 -6
- data/tracks/typescript/exercises/bob/yarn.lock +929 -610
- data/tracks/typescript/exercises/circular-buffer/package.json +6 -6
- data/tracks/typescript/exercises/circular-buffer/yarn.lock +929 -610
- data/tracks/typescript/exercises/clock/package.json +6 -6
- data/tracks/typescript/exercises/clock/yarn.lock +929 -610
- data/tracks/typescript/exercises/difference-of-squares/package.json +6 -6
- data/tracks/typescript/exercises/difference-of-squares/yarn.lock +929 -610
- data/tracks/typescript/exercises/etl/package.json +6 -6
- data/tracks/typescript/exercises/etl/yarn.lock +929 -610
- data/tracks/typescript/exercises/food-chain/package.json +6 -6
- data/tracks/typescript/exercises/food-chain/yarn.lock +929 -610
- data/tracks/typescript/exercises/gigasecond/package.json +6 -6
- data/tracks/typescript/exercises/gigasecond/yarn.lock +929 -610
- data/tracks/typescript/exercises/grade-school/package.json +6 -6
- data/tracks/typescript/exercises/grade-school/yarn.lock +929 -610
- data/tracks/typescript/exercises/hamming/package.json +6 -6
- data/tracks/typescript/exercises/hamming/yarn.lock +929 -610
- data/tracks/typescript/exercises/hello-world/README.md +354 -0
- data/tracks/typescript/exercises/hello-world/package.json +6 -6
- data/tracks/typescript/exercises/hello-world/yarn.lock +929 -610
- data/tracks/typescript/exercises/largest-series-product/package.json +6 -6
- data/tracks/typescript/exercises/largest-series-product/yarn.lock +929 -610
- data/tracks/typescript/exercises/leap/package.json +6 -6
- data/tracks/typescript/exercises/leap/yarn.lock +929 -610
- data/tracks/typescript/exercises/linked-list/package.json +6 -6
- data/tracks/typescript/exercises/linked-list/yarn.lock +929 -610
- data/tracks/typescript/exercises/nth-prime/package.json +6 -6
- data/tracks/typescript/exercises/nth-prime/yarn.lock +929 -610
- data/tracks/typescript/exercises/pangram/package.json +6 -6
- data/tracks/typescript/exercises/pangram/yarn.lock +929 -610
- data/tracks/typescript/exercises/pascals-triangle/package.json +6 -6
- data/tracks/typescript/exercises/pascals-triangle/yarn.lock +929 -610
- data/tracks/typescript/exercises/phone-number/package.json +6 -6
- data/tracks/typescript/exercises/phone-number/yarn.lock +929 -610
- data/tracks/typescript/exercises/prime-factors/package.json +6 -6
- data/tracks/typescript/exercises/prime-factors/yarn.lock +929 -610
- data/tracks/typescript/exercises/raindrops/package.json +6 -6
- data/tracks/typescript/exercises/raindrops/yarn.lock +929 -610
- data/tracks/typescript/exercises/rna-transcription/package.json +6 -6
- data/tracks/typescript/exercises/rna-transcription/yarn.lock +929 -610
- data/tracks/typescript/exercises/robot-name/package.json +6 -6
- data/tracks/typescript/exercises/robot-name/yarn.lock +929 -610
- data/tracks/typescript/exercises/robot-simulator/package.json +6 -6
- data/tracks/typescript/exercises/robot-simulator/yarn.lock +929 -610
- data/tracks/typescript/exercises/rotational-cipher/package.json +6 -6
- data/tracks/typescript/exercises/rotational-cipher/yarn.lock +929 -610
- data/tracks/typescript/exercises/say/package.json +6 -6
- data/tracks/typescript/exercises/say/yarn.lock +929 -610
- data/tracks/typescript/exercises/scrabble-score/package.json +6 -6
- data/tracks/typescript/exercises/scrabble-score/yarn.lock +929 -610
- data/tracks/typescript/exercises/series/package.json +6 -6
- data/tracks/typescript/exercises/series/yarn.lock +929 -610
- data/tracks/typescript/exercises/space-age/package.json +6 -6
- data/tracks/typescript/exercises/space-age/yarn.lock +929 -610
- data/tracks/typescript/exercises/strain/package.json +6 -6
- data/tracks/typescript/exercises/strain/yarn.lock +929 -610
- data/tracks/typescript/exercises/sum-of-multiples/package.json +6 -6
- data/tracks/typescript/exercises/sum-of-multiples/yarn.lock +929 -610
- data/tracks/typescript/exercises/triangle/package.json +6 -6
- data/tracks/typescript/exercises/triangle/yarn.lock +929 -610
- data/tracks/typescript/exercises/word-count/package.json +6 -6
- data/tracks/typescript/exercises/word-count/yarn.lock +929 -610
- data/tracks/typescript/exercises/wordy/package.json +6 -6
- data/tracks/typescript/exercises/wordy/yarn.lock +929 -610
- metadata +37 -2
@@ -2,21 +2,21 @@ exercise: SpaceAge
|
|
2
2
|
version: 1
|
3
3
|
plan: 10
|
4
4
|
imports: Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune
|
5
|
-
tests:
|
5
|
+
tests: |-
|
6
6
|
is (age-on ::(.<planet>): .<seconds>), |.<expected description> for @($c-data<cases>);
|
7
7
|
|
8
8
|
unit: module
|
9
|
-
example:
|
9
|
+
example: |-
|
10
10
|
role Planet {
|
11
11
|
method age-on ($seconds) {
|
12
12
|
($seconds / self.orbital-period).round(0.01);
|
13
13
|
}
|
14
14
|
}
|
15
|
-
|
15
|
+
|
16
16
|
class Earth does Planet is export {
|
17
17
|
my $.orbital-period = 31557600;
|
18
18
|
}
|
19
|
-
|
19
|
+
|
20
20
|
my %planets = (
|
21
21
|
:Mercury(0.2408467),
|
22
22
|
:Venus(0.61519726),
|
@@ -31,20 +31,20 @@ example: |
|
|
31
31
|
OUR::EXPORT::ALL::{$planet} := OUR::EXPORT::DEFAULT::{$planet} := EVAL "class $planet does Planet is export " ~
|
32
32
|
'{ my $.orbital-period = calculate-orbital-period $relative }';
|
33
33
|
}
|
34
|
-
|
34
|
+
|
35
35
|
sub calculate-orbital-period ($relative-to-earth) {
|
36
36
|
Earth.orbital-period * $relative-to-earth;
|
37
37
|
}
|
38
|
-
stub:
|
38
|
+
stub: |-
|
39
39
|
role Planet {
|
40
40
|
method age-on ($seconds) {
|
41
41
|
}
|
42
42
|
}
|
43
|
-
|
43
|
+
|
44
44
|
class Earth does Planet is export {
|
45
45
|
my $.orbital-period = 31557600;
|
46
46
|
}
|
47
|
-
|
47
|
+
|
48
48
|
=for comment
|
49
49
|
---
|
50
50
|
Orbital periods relative to Earth:
|
@@ -2,14 +2,14 @@ exercise: WordCount
|
|
2
2
|
version: 1
|
3
3
|
plan: 12
|
4
4
|
imports: '&count-words'
|
5
|
-
tests:
|
5
|
+
tests: |-
|
6
6
|
is-deeply (% = .<input>.&count-words), |.<expected description> for @($c-data<cases>);
|
7
7
|
|
8
8
|
unit: module
|
9
|
-
example:
|
9
|
+
example: |-
|
10
10
|
sub count-words (Str:D $str --> Hash:D) is export {
|
11
11
|
$str.lc.comb(/ <alnum>+ (\'<alnum>+)? /).Bag.hash
|
12
12
|
}
|
13
|
-
stub:
|
13
|
+
stub: |-
|
14
14
|
sub count-words ($str) is export {
|
15
15
|
}
|
@@ -2,7 +2,7 @@ exercise: Wordy
|
|
2
2
|
version: 1
|
3
3
|
plan: 18
|
4
4
|
imports: '&answer'
|
5
|
-
tests:
|
5
|
+
tests: |-
|
6
6
|
for @($c-data<cases>) {
|
7
7
|
if .<expected> === False {
|
8
8
|
throws-like {.<input>.&answer}, Exception, .<description>;
|
@@ -12,7 +12,7 @@ tests: |
|
|
12
12
|
}
|
13
13
|
|
14
14
|
unit: module
|
15
|
-
example:
|
15
|
+
example: |-
|
16
16
|
sub answer ($q is copy) is export {
|
17
17
|
given $q {
|
18
18
|
s:s:g/^What is|\?$//;
|
@@ -27,6 +27,6 @@ example: |
|
|
27
27
|
use MONKEY-SEE-NO-EVAL;
|
28
28
|
EVAL $q or fail;
|
29
29
|
}
|
30
|
-
stub:
|
30
|
+
stub: |-
|
31
31
|
sub answer ($question) is export {
|
32
32
|
}
|
data/tracks/python/config.json
CHANGED
@@ -771,6 +771,20 @@
|
|
771
771
|
"transforming"
|
772
772
|
]
|
773
773
|
},
|
774
|
+
{
|
775
|
+
"uuid": "6aacc273-0a33-8180-679e-c12c440c0fcf89e1fb6",
|
776
|
+
"slug": "tree-building",
|
777
|
+
"core": false,
|
778
|
+
"unlocked_by": null,
|
779
|
+
"difficulty": 3,
|
780
|
+
"topics": [
|
781
|
+
"refactoring",
|
782
|
+
"sorting",
|
783
|
+
"trees",
|
784
|
+
"records",
|
785
|
+
"maps"
|
786
|
+
]
|
787
|
+
},
|
774
788
|
{
|
775
789
|
"uuid": "dcc0ee26-e384-4bd4-8c4b-613fa0bb8188",
|
776
790
|
"slug": "poker",
|
@@ -19,6 +19,36 @@
|
|
19
19
|
"link_text": null,
|
20
20
|
"link_url": null,
|
21
21
|
"avatar_url": null
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"github_username": "N-Parsons",
|
25
|
+
"show_on_website": true,
|
26
|
+
"alumnus": false,
|
27
|
+
"name": "Nathan Parsons",
|
28
|
+
"bio": "Python fits with how I think and allows me to quickly write powerful, maintainable, and extensible code.",
|
29
|
+
"link_text": null,
|
30
|
+
"link_url": null,
|
31
|
+
"avatar_url": null
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"github_username": "m-a-ge",
|
35
|
+
"show_on_website": false,
|
36
|
+
"alumnus": false,
|
37
|
+
"name": null,
|
38
|
+
"bio": null,
|
39
|
+
"link_text": null,
|
40
|
+
"link_url": null,
|
41
|
+
"avatar_url": null
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"github_username": "cmccandless",
|
45
|
+
"show_on_website": false,
|
46
|
+
"alumnus": false,
|
47
|
+
"name": null,
|
48
|
+
"bio": null,
|
49
|
+
"link_text": null,
|
50
|
+
"link_url": null,
|
51
|
+
"avatar_url": null
|
22
52
|
}
|
23
53
|
],
|
24
54
|
"docs_url": "https://github.com/exercism/docs/blob/master/maintaining-a-track/maintainer-configuration.md"
|
@@ -1,9 +1,8 @@
|
|
1
|
-
|
1
|
+
## Submitting Exercises
|
2
2
|
|
3
3
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
4
4
|
|
5
5
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
6
6
|
|
7
|
-
|
8
7
|
For more detailed information about running tests, code style and linting,
|
9
8
|
please see the [help page](http://exercism.io/languages/python).
|
@@ -25,16 +25,12 @@ Keep your hands off that collect/map/fmap/whatchamacallit functionality
|
|
25
25
|
provided by your standard library!
|
26
26
|
Solve this one yourself using other basic tools instead.
|
27
27
|
|
28
|
-
|
29
|
-
as this is idiomatic Lisp, not a library function.
|
30
|
-
|
31
|
-
### Submitting Exercises
|
28
|
+
## Submitting Exercises
|
32
29
|
|
33
30
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
34
31
|
|
35
32
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
36
33
|
|
37
|
-
|
38
34
|
For more detailed information about running tests, code style and linting,
|
39
35
|
please see the [help page](http://exercism.io/languages/python).
|
40
36
|
|
@@ -7,14 +7,12 @@ Techies love their TLA (Three Letter Acronyms)!
|
|
7
7
|
Help generate some jargon by writing a program that converts a long name
|
8
8
|
like Portable Network Graphics to its acronym (PNG).
|
9
9
|
|
10
|
-
|
11
|
-
### Submitting Exercises
|
10
|
+
## Submitting Exercises
|
12
11
|
|
13
12
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
14
13
|
|
15
14
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
16
15
|
|
17
|
-
|
18
16
|
For more detailed information about running tests, code style and linting,
|
19
17
|
please see the [help page](http://exercism.io/languages/python).
|
20
18
|
|
@@ -6,6 +6,7 @@ Implement general base conversion. Given a number in base **a**,
|
|
6
6
|
represented as a sequence of digits, convert it to base **b**.
|
7
7
|
|
8
8
|
## Note
|
9
|
+
|
9
10
|
- Try to implement the conversion yourself.
|
10
11
|
Do not use something else to perform the conversion for you.
|
11
12
|
|
@@ -28,16 +29,14 @@ The number 1120, *in base 3*, means:
|
|
28
29
|
|
29
30
|
I think you got the idea!
|
30
31
|
|
31
|
-
|
32
32
|
*Yes. Those three numbers above are exactly the same. Congratulations!*
|
33
33
|
|
34
|
-
|
34
|
+
## Submitting Exercises
|
35
35
|
|
36
36
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
37
37
|
|
38
38
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
39
39
|
|
40
|
-
|
41
40
|
For more detailed information about running tests, code style and linting,
|
42
41
|
please see the [help page](http://exercism.io/languages/python).
|
43
42
|
|
@@ -3,7 +3,7 @@ import unittest
|
|
3
3
|
from all_your_base import rebase
|
4
4
|
|
5
5
|
|
6
|
-
#
|
6
|
+
# Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0
|
7
7
|
|
8
8
|
class AllYourBaseTests(unittest.TestCase):
|
9
9
|
|
@@ -43,6 +43,18 @@ class AllYourBaseTests(unittest.TestCase):
|
|
43
43
|
def test_leading_zeros(self):
|
44
44
|
self.assertEqual(rebase(7, [0, 6, 0], 10), [4, 2])
|
45
45
|
|
46
|
+
def test_first_base_is_one(self):
|
47
|
+
with self.assertRaises(ValueError):
|
48
|
+
rebase(1, [], 10)
|
49
|
+
|
50
|
+
def test_first_base_is_zero(self):
|
51
|
+
with self.assertRaises(ValueError):
|
52
|
+
rebase(0, [], 10)
|
53
|
+
|
54
|
+
def test_first_base_is_negative(self):
|
55
|
+
with self.assertRaises(ValueError):
|
56
|
+
rebase(-2, [1], 10)
|
57
|
+
|
46
58
|
def test_negative_digit(self):
|
47
59
|
with self.assertRaises(ValueError):
|
48
60
|
rebase(2, [1, -1, 1, 0, 1, 0], 10)
|
@@ -51,26 +63,14 @@ class AllYourBaseTests(unittest.TestCase):
|
|
51
63
|
with self.assertRaises(ValueError):
|
52
64
|
rebase(2, [1, 2, 1, 0, 1, 0], 10)
|
53
65
|
|
54
|
-
def test_first_base_is_one(self):
|
55
|
-
with self.assertRaises(ValueError):
|
56
|
-
rebase(1, [], 10)
|
57
|
-
|
58
66
|
def test_second_base_is_one(self):
|
59
67
|
with self.assertRaises(ValueError):
|
60
68
|
rebase(2, [1, 0, 1, 0, 1, 0], 1)
|
61
69
|
|
62
|
-
def test_first_base_is_zero(self):
|
63
|
-
with self.assertRaises(ValueError):
|
64
|
-
rebase(0, [], 10)
|
65
|
-
|
66
70
|
def test_second_base_is_zero(self):
|
67
71
|
with self.assertRaises(ValueError):
|
68
72
|
rebase(10, [7], 0)
|
69
73
|
|
70
|
-
def test_first_base_is_negative(self):
|
71
|
-
with self.assertRaises(ValueError):
|
72
|
-
rebase(-2, [1], 10)
|
73
|
-
|
74
74
|
def test_second_base_is_negative(self):
|
75
75
|
with self.assertRaises(ValueError):
|
76
76
|
rebase(2, [1], -7)
|
@@ -29,14 +29,12 @@ allergens that score 256, 512, 1024, etc.). Your program should
|
|
29
29
|
ignore those components of the score. For example, if the allergy
|
30
30
|
score is 257, your program should only report the eggs (1) allergy.
|
31
31
|
|
32
|
-
|
33
|
-
### Submitting Exercises
|
32
|
+
## Submitting Exercises
|
34
33
|
|
35
34
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
36
35
|
|
37
36
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
38
37
|
|
39
|
-
|
40
38
|
For more detailed information about running tests, code style and linting,
|
41
39
|
please see the [help page](http://exercism.io/languages/python).
|
42
40
|
|
@@ -7,7 +7,7 @@ letters in words are replaced with numbers.
|
|
7
7
|
|
8
8
|
For example `SEND + MORE = MONEY`:
|
9
9
|
|
10
|
-
```
|
10
|
+
```text
|
11
11
|
S E N D
|
12
12
|
M O R E +
|
13
13
|
-----------
|
@@ -16,7 +16,7 @@ M O N E Y
|
|
16
16
|
|
17
17
|
Replacing these with valid numbers gives:
|
18
18
|
|
19
|
-
```
|
19
|
+
```text
|
20
20
|
9 5 6 7
|
21
21
|
1 0 8 5 +
|
22
22
|
-----------
|
@@ -31,13 +31,12 @@ a multi-digit number must not be zero.
|
|
31
31
|
|
32
32
|
Write a function to solve alphametics puzzles.
|
33
33
|
|
34
|
-
|
34
|
+
## Submitting Exercises
|
35
35
|
|
36
36
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
37
37
|
|
38
38
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
39
39
|
|
40
|
-
|
41
40
|
For more detailed information about running tests, code style and linting,
|
42
41
|
please see the [help page](http://exercism.io/languages/python).
|
43
42
|
|
@@ -6,13 +6,12 @@ Given `"listen"` and a list of candidates like `"enlists" "google"
|
|
6
6
|
"inlets" "banana"` the program should return a list containing
|
7
7
|
`"inlets"`.
|
8
8
|
|
9
|
-
|
9
|
+
## Submitting Exercises
|
10
10
|
|
11
11
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
12
12
|
|
13
13
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
14
14
|
|
15
|
-
|
16
15
|
For more detailed information about running tests, code style and linting,
|
17
16
|
please see the [help page](http://exercism.io/languages/python).
|
18
17
|
|
@@ -9,7 +9,7 @@ letter, the second with the second-last, and so on.
|
|
9
9
|
|
10
10
|
An Atbash cipher for the Latin alphabet would be as follows:
|
11
11
|
|
12
|
-
```
|
12
|
+
```text
|
13
13
|
Plain: abcdefghijklmnopqrstuvwxyz
|
14
14
|
Cipher: zyxwvutsrqponmlkjihgfedcba
|
15
15
|
```
|
@@ -23,17 +23,17 @@ being 5 letters, and punctuation is excluded. This is to make it harder to guess
|
|
23
23
|
things based on word boundaries.
|
24
24
|
|
25
25
|
## Examples
|
26
|
+
|
26
27
|
- Encoding `test` gives `gvhg`
|
27
28
|
- Decoding `gvhg` gives `test`
|
28
29
|
- Decoding `gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt` gives `thequickbrownfoxjumpsoverthelazydog`
|
29
30
|
|
30
|
-
|
31
|
+
## Submitting Exercises
|
31
32
|
|
32
33
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
33
34
|
|
34
35
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
35
36
|
|
36
|
-
|
37
37
|
For more detailed information about running tests, code style and linting,
|
38
38
|
please see the [help page](http://exercism.io/languages/python).
|
39
39
|
|
@@ -4,7 +4,7 @@ Produce the lyrics to that beloved classic, that field-trip favorite: 99 Bottles
|
|
4
4
|
|
5
5
|
Note that not all verses are identical.
|
6
6
|
|
7
|
-
```
|
7
|
+
```text
|
8
8
|
99 bottles of beer on the wall, 99 bottles of beer.
|
9
9
|
Take one down and pass it around, 98 bottles of beer on the wall.
|
10
10
|
|
@@ -320,13 +320,12 @@ are some additional things you could try:
|
|
320
320
|
Then please share your thoughts in a comment on the submission. Did this
|
321
321
|
experiment make the code better? Worse? Did you learn anything from it?
|
322
322
|
|
323
|
-
|
323
|
+
## Submitting Exercises
|
324
324
|
|
325
325
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
326
326
|
|
327
327
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
328
328
|
|
329
|
-
|
330
329
|
For more detailed information about running tests, code style and linting,
|
331
330
|
please see the [help page](http://exercism.io/languages/python).
|
332
331
|
|
@@ -34,13 +34,12 @@ A binary search halves the number of items to check with each iteration,
|
|
34
34
|
so locating an item (or determining its absence) takes logarithmic time.
|
35
35
|
A binary search is a dichotomic divide and conquer search algorithm.
|
36
36
|
|
37
|
-
|
37
|
+
## Submitting Exercises
|
38
38
|
|
39
39
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
40
40
|
|
41
41
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
42
42
|
|
43
|
-
|
44
43
|
For more detailed information about running tests, code style and linting,
|
45
44
|
please see the [help page](http://exercism.io/languages/python).
|
46
45
|
|
@@ -7,10 +7,12 @@ string, your program should produce a decimal output. The
|
|
7
7
|
program should handle invalid inputs.
|
8
8
|
|
9
9
|
## Note
|
10
|
+
|
10
11
|
- Implement the conversion yourself.
|
11
12
|
Do not use something else to perform the conversion for you.
|
12
13
|
|
13
14
|
## About Binary (Base-2)
|
15
|
+
|
14
16
|
Decimal is a base-10 system.
|
15
17
|
|
16
18
|
A number 23 in base 10 notation can be understood
|
@@ -28,13 +30,12 @@ Binary is similar, but uses powers of 2 rather than powers of 10.
|
|
28
30
|
|
29
31
|
So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`.
|
30
32
|
|
31
|
-
|
33
|
+
## Submitting Exercises
|
32
34
|
|
33
35
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
34
36
|
|
35
37
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
36
38
|
|
37
|
-
|
38
39
|
For more detailed information about running tests, code style and linting,
|
39
40
|
please see the [help page](http://exercism.io/languages/python).
|
40
41
|
|
@@ -11,13 +11,12 @@ anything.
|
|
11
11
|
|
12
12
|
He answers 'Whatever.' to anything else.
|
13
13
|
|
14
|
-
|
14
|
+
## Submitting Exercises
|
15
15
|
|
16
16
|
Note that, when trying to submit an exercise, make sure the solution is in the `exercism/python/<exerciseName>` directory.
|
17
17
|
|
18
18
|
For example, if you're submitting `bob.py` for the Bob exercise, the submit command would be something like `exercism submit <path_to_exercism_dir>/python/bob/bob.py`.
|
19
19
|
|
20
|
-
|
21
20
|
For more detailed information about running tests, code style and linting,
|
22
21
|
please see the [help page](http://exercism.io/languages/python).
|
23
22
|
|