trackler 2.2.1.1 → 2.2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/tracks/erlang/config/maintainers.json +29 -0
  4. data/tracks/go/config.json +11 -8
  5. data/tracks/haskell/config/maintainers.json +44 -0
  6. data/tracks/java/docs/TESTS.md +3 -3
  7. data/tracks/javascript/config.json +14 -3
  8. data/tracks/javascript/exercises/sublist/README.md +50 -0
  9. data/tracks/javascript/exercises/sublist/example.js +31 -0
  10. data/tracks/javascript/exercises/sublist/sublist.spec.js +126 -0
  11. data/tracks/pony/README.md +1 -1
  12. data/tracks/pony/config.json +0 -2
  13. data/tracks/pony/config/exercise_readme.go.tmpl +16 -0
  14. data/tracks/pony/exercises/anagram/README.md +13 -0
  15. data/tracks/pony/exercises/atbash-cipher/README.md +34 -0
  16. data/tracks/pony/exercises/beer-song/README.md +327 -0
  17. data/tracks/pony/exercises/bob/README.md +18 -0
  18. data/tracks/pony/exercises/difference-of-squares/README.md +19 -0
  19. data/tracks/pony/exercises/hamming/README.md +42 -0
  20. data/tracks/pony/exercises/hello-world/README.md +21 -0
  21. data/tracks/pony/exercises/leap/README.md +33 -0
  22. data/tracks/pony/exercises/pascals-triangle/README.md +21 -0
  23. data/tracks/pony/exercises/rna-transcription/README.md +25 -0
  24. data/tracks/pony/exercises/roman-numerals/README.md +49 -0
  25. data/tracks/ruby/config.json +13 -0
  26. data/tracks/ruby/config/maintainers.json +64 -0
  27. data/tracks/ruby/exercises/rotational-cipher/.meta/.version +1 -0
  28. data/tracks/ruby/exercises/rotational-cipher/.meta/generator/rotational_cipher_case.rb +9 -0
  29. data/tracks/ruby/exercises/rotational-cipher/.meta/solutions/rotational_cipher.rb +53 -0
  30. data/tracks/ruby/exercises/rotational-cipher/rotational_cipher_test.rb +77 -0
  31. metadata +24 -2
@@ -0,0 +1,21 @@
1
+ # Hello World
2
+
3
+ The classical introductory exercise. Just say "Hello, World!".
4
+
5
+ ["Hello, World!"](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program) is
6
+ the traditional first program for beginning programming in a new language
7
+ or environment.
8
+
9
+ The objectives are simple:
10
+
11
+ - Write a function that returns the string "Hello, World!".
12
+ - Run the test suite and make sure that it succeeds.
13
+ - Submit your solution and check it at the website.
14
+
15
+ If everything goes well, you will be ready to fetch your first real exercise.
16
+ ## Source
17
+
18
+ This is an exercise to introduce users to using Exercism [http://en.wikipedia.org/wiki/%22Hello,_world!%22_program](http://en.wikipedia.org/wiki/%22Hello,_world!%22_program)
19
+
20
+ ## Submitting Incomplete Solutions
21
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,33 @@
1
+ # Leap
2
+
3
+ Given a year, report if it is a leap year.
4
+
5
+ The tricky thing here is that a leap year in the Gregorian calendar occurs:
6
+
7
+ ```plain
8
+ on every year that is evenly divisible by 4
9
+ except every year that is evenly divisible by 100
10
+ unless the year is also evenly divisible by 400
11
+ ```
12
+
13
+ For example, 1997 is not a leap year, but 1996 is. 1900 is not a leap
14
+ year, but 2000 is.
15
+
16
+ If your language provides a method in the standard library that does
17
+ this look-up, pretend it doesn't exist and implement it yourself.
18
+
19
+ ## Notes
20
+
21
+ Though our exercise adopts some very simple rules, there is more to
22
+ learn!
23
+
24
+ For a delightful, four minute explanation of the whole leap year
25
+ phenomenon, go watch [this youtube video][video].
26
+
27
+ [video]: http://www.youtube.com/watch?v=xX96xng7sAE
28
+ ## Source
29
+
30
+ JavaRanch Cattle Drive, exercise 3 [http://www.javaranch.com/leap.jsp](http://www.javaranch.com/leap.jsp)
31
+
32
+ ## Submitting Incomplete Solutions
33
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,21 @@
1
+ # Pascals Triangle
2
+
3
+ Compute Pascal's triangle up to a given number of rows.
4
+
5
+ In Pascal's Triangle each number is computed by adding the numbers to
6
+ the right and left of the current position in the previous row.
7
+
8
+ ```plain
9
+ 1
10
+ 1 1
11
+ 1 2 1
12
+ 1 3 3 1
13
+ 1 4 6 4 1
14
+ # ... etc
15
+ ```
16
+ ## Source
17
+
18
+ Pascal's Triangle at Wolfram Math World [http://mathworld.wolfram.com/PascalsTriangle.html](http://mathworld.wolfram.com/PascalsTriangle.html)
19
+
20
+ ## Submitting Incomplete Solutions
21
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,25 @@
1
+ # Rna Transcription
2
+
3
+ Given a DNA strand, return its RNA complement (per RNA transcription).
4
+
5
+ Both DNA and RNA strands are a sequence of nucleotides.
6
+
7
+ The four nucleotides found in DNA are adenine (**A**), cytosine (**C**),
8
+ guanine (**G**) and thymine (**T**).
9
+
10
+ The four nucleotides found in RNA are adenine (**A**), cytosine (**C**),
11
+ guanine (**G**) and uracil (**U**).
12
+
13
+ Given a DNA strand, its transcribed RNA strand is formed by replacing
14
+ each nucleotide with its complement:
15
+
16
+ * `G` -> `C`
17
+ * `C` -> `G`
18
+ * `T` -> `A`
19
+ * `A` -> `U`
20
+ ## Source
21
+
22
+ Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna)
23
+
24
+ ## Submitting Incomplete Solutions
25
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -0,0 +1,49 @@
1
+ # Roman Numerals
2
+
3
+ Write a function to convert from normal numbers to Roman Numerals.
4
+
5
+ The Romans were a clever bunch. They conquered most of Europe and ruled
6
+ it for hundreds of years. They invented concrete and straight roads and
7
+ even bikinis. One thing they never discovered though was the number
8
+ zero. This made writing and dating extensive histories of their exploits
9
+ slightly more challenging, but the system of numbers they came up with
10
+ is still in use today. For example the BBC uses Roman numerals to date
11
+ their programmes.
12
+
13
+ The Romans wrote numbers using letters - I, V, X, L, C, D, M. (notice
14
+ these letters have lots of straight lines and are hence easy to hack
15
+ into stone tablets).
16
+
17
+ ```
18
+ 1 => I
19
+ 10 => X
20
+ 7 => VII
21
+ ```
22
+
23
+ There is no need to be able to convert numbers larger than about 3000.
24
+ (The Romans themselves didn't tend to go any higher)
25
+
26
+ Wikipedia says: Modern Roman numerals ... are written by expressing each
27
+ digit separately starting with the left most digit and skipping any
28
+ digit with a value of zero.
29
+
30
+ To see this in practice, consider the example of 1990.
31
+
32
+ In Roman numerals 1990 is MCMXC:
33
+
34
+ 1000=M
35
+ 900=CM
36
+ 90=XC
37
+
38
+ 2008 is written as MMVIII:
39
+
40
+ 2000=MM
41
+ 8=VIII
42
+
43
+ See also: http://www.novaroma.org/via_romana/numbers.html
44
+ ## Source
45
+
46
+ The Roman Numeral Kata [http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals](http://codingdojo.org/cgi-bin/index.pl?KataRomanNumerals)
47
+
48
+ ## Submitting Incomplete Solutions
49
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.
@@ -859,6 +859,19 @@
859
859
  "Mathematics"
860
860
  ]
861
861
  },
862
+ {
863
+ "uuid": "af5ccf14-eff2-4dc6-b1db-e209cddca62a",
864
+ "slug": "rotational-cipher",
865
+ "core": false,
866
+ "unlocked_by": null,
867
+ "difficulty": 1,
868
+ "topics": [
869
+ "Control-flow (conditionals)",
870
+ "Control-flow (loops)",
871
+ "Logic",
872
+ "Strings"
873
+ ]
874
+ },
862
875
  {
863
876
  "uuid": "cae4e000-3aac-41f7-b727-f9cce12d058d",
864
877
  "slug": "octal",
@@ -0,0 +1,64 @@
1
+ {
2
+ "maintainers": [
3
+ {
4
+ "github_username": "kotp",
5
+ "show_on_website": false,
6
+ "alumnus": false,
7
+ "name": null,
8
+ "bio": null,
9
+ "link_text": null,
10
+ "link_url": null,
11
+ "avatar_url": null
12
+ },
13
+ {
14
+ "github_username": "bernardoamc",
15
+ "show_on_website": false,
16
+ "alumnus": false,
17
+ "name": null,
18
+ "bio": null,
19
+ "link_text": null,
20
+ "link_url": null,
21
+ "avatar_url": null
22
+ },
23
+ {
24
+ "github_username": "tommyschaefer",
25
+ "show_on_website": false,
26
+ "alumnus": false,
27
+ "name": null,
28
+ "bio": null,
29
+ "link_text": null,
30
+ "link_url": null,
31
+ "avatar_url": null
32
+ },
33
+ {
34
+ "github_username": "hilary",
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": "bmulvihill",
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
52
+ },
53
+ {
54
+ "github_username": "Insti",
55
+ "show_on_website": false,
56
+ "alumnus": false,
57
+ "name": null,
58
+ "bio": null,
59
+ "link_text": null,
60
+ "link_url": null,
61
+ "avatar_url": null
62
+ }
63
+ ]
64
+ }
@@ -0,0 +1,9 @@
1
+ require 'generator/exercise_case'
2
+
3
+ class RotationalCipherCase < Generator::ExerciseCase
4
+
5
+ def workload
6
+ assert_equal { %Q[RotationalCipher.rotate("#{text}", #{shiftKey})] }
7
+ end
8
+
9
+ end
@@ -0,0 +1,53 @@
1
+ module BookKeeping
2
+ VERSION = 1
3
+ end
4
+
5
+ class RotationalCipher
6
+ SMALL_LETTERS_RANGE = (97..122)
7
+ BIG_LETTERS_RANGE = (65..90)
8
+ ROTATION_MODIFIER = 1
9
+
10
+ attr_reader :text
11
+
12
+ def initialize(text, key)
13
+ @text = text
14
+ @shift_key = key
15
+ end
16
+
17
+ def self.rotate(text, key)
18
+ new(text, key).rotate
19
+ end
20
+
21
+ def rotate
22
+ text.split('').map { |char| shift_char(char) }.join
23
+ end
24
+
25
+ private
26
+
27
+ def shift_char(char)
28
+ shift_ascii(char.ord).chr
29
+ end
30
+
31
+ def shift_key
32
+ @shift_key % 26
33
+ end
34
+
35
+ def shift_ascii(char_ascii)
36
+ case char_ascii
37
+ when SMALL_LETTERS_RANGE
38
+ shift_within(char_ascii, SMALL_LETTERS_RANGE.min, SMALL_LETTERS_RANGE.max)
39
+ when BIG_LETTERS_RANGE
40
+ shift_within(char_ascii, BIG_LETTERS_RANGE.min, BIG_LETTERS_RANGE.max)
41
+ else
42
+ char_ascii
43
+ end
44
+ end
45
+
46
+ def shift_within(char_ascii, lower_limit, upper_limit)
47
+ shifted_ascii = char_ascii + shift_key
48
+
49
+ return shifted_ascii if shifted_ascii <= upper_limit
50
+
51
+ lower_limit + (shifted_ascii - upper_limit - ROTATION_MODIFIER)
52
+ end
53
+ end
@@ -0,0 +1,77 @@
1
+ require 'minitest/autorun'
2
+ require_relative 'rotational_cipher'
3
+
4
+ # Common test data version: 1.1.0 9c658d1
5
+ class RotationalCipherTest < Minitest::Test
6
+ def test_rotate_a_by_0_same_output_as_input
7
+ # skip
8
+ assert_equal "a", RotationalCipher.rotate("a", 0)
9
+ end
10
+
11
+ def test_rotate_a_by_1
12
+ skip
13
+ assert_equal "b", RotationalCipher.rotate("a", 1)
14
+ end
15
+
16
+ def test_rotate_a_by_26_same_output_as_input
17
+ skip
18
+ assert_equal "a", RotationalCipher.rotate("a", 26)
19
+ end
20
+
21
+ def test_rotate_m_by_13
22
+ skip
23
+ assert_equal "z", RotationalCipher.rotate("m", 13)
24
+ end
25
+
26
+ def test_rotate_n_by_13_with_wrap_around_alphabet
27
+ skip
28
+ assert_equal "a", RotationalCipher.rotate("n", 13)
29
+ end
30
+
31
+ def test_rotate_capital_letters
32
+ skip
33
+ assert_equal "TRL", RotationalCipher.rotate("OMG", 5)
34
+ end
35
+
36
+ def test_rotate_spaces
37
+ skip
38
+ assert_equal "T R L", RotationalCipher.rotate("O M G", 5)
39
+ end
40
+
41
+ def test_rotate_numbers
42
+ skip
43
+ assert_equal "Xiwxmrk 1 2 3 xiwxmrk", RotationalCipher.rotate("Testing 1 2 3 testing", 4)
44
+ end
45
+
46
+ def test_rotate_punctuation
47
+ skip
48
+ assert_equal "Gzo'n zvo, Bmviyhv!", RotationalCipher.rotate("Let's eat, Grandma!", 21)
49
+ end
50
+
51
+ def test_rotate_all_letters
52
+ skip
53
+ assert_equal "Gur dhvpx oebja sbk whzcf bire gur ynml qbt.", RotationalCipher.rotate("The quick brown fox jumps over the lazy dog.", 13)
54
+ end
55
+
56
+ # Problems in exercism evolve over time, as we find better ways to ask
57
+ # questions.
58
+ # The version number refers to the version of the problem you solved,
59
+ # not your solution.
60
+ #
61
+ # Define a constant named VERSION inside of the top level BookKeeping
62
+ # module, which may be placed near the end of your file.
63
+ #
64
+ # In your file, it will look like this:
65
+ #
66
+ # module BookKeeping
67
+ # VERSION = 1 # Where the version number matches the one in the test.
68
+ # end
69
+ #
70
+ # If you are curious, read more about constants on RubyDoc:
71
+ # http://ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/constants.html
72
+
73
+ def test_bookkeeping
74
+ skip
75
+ assert_equal 1, BookKeeping::VERSION
76
+ end
77
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackler
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1.1
4
+ version: 2.2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Owen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-24 00:00:00.000000000 Z
11
+ date: 2017-07-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -3597,6 +3597,7 @@ files:
3597
3597
  - tracks/erlang/bin/journey-test.sh
3598
3598
  - tracks/erlang/config.json
3599
3599
  - tracks/erlang/config/exercise_readme.go.tmpl
3600
+ - tracks/erlang/config/maintainers.json
3600
3601
  - tracks/erlang/docs/ABOUT.md
3601
3602
  - tracks/erlang/docs/EXERCISE_README_INSERT.md
3602
3603
  - tracks/erlang/docs/INSTALLATION.md
@@ -4697,6 +4698,7 @@ files:
4697
4698
  - tracks/haskell/bin/test-stub
4698
4699
  - tracks/haskell/config.json
4699
4700
  - tracks/haskell/config/exercise_readme.go.tmpl
4701
+ - tracks/haskell/config/maintainers.json
4700
4702
  - tracks/haskell/docs/ABOUT.md
4701
4703
  - tracks/haskell/docs/EXERCISE_README_INSERT.md
4702
4704
  - tracks/haskell/docs/INSTALLATION.md
@@ -6127,6 +6129,9 @@ files:
6127
6129
  - tracks/javascript/exercises/strain/README.md
6128
6130
  - tracks/javascript/exercises/strain/example.js
6129
6131
  - tracks/javascript/exercises/strain/strain.spec.js
6132
+ - tracks/javascript/exercises/sublist/README.md
6133
+ - tracks/javascript/exercises/sublist/example.js
6134
+ - tracks/javascript/exercises/sublist/sublist.spec.js
6130
6135
  - tracks/javascript/exercises/sum-of-multiples/README.md
6131
6136
  - tracks/javascript/exercises/sum-of-multiples/example.js
6132
6137
  - tracks/javascript/exercises/sum-of-multiples/sum-of-multiples.spec.js
@@ -8430,32 +8435,44 @@ files:
8430
8435
  - tracks/pony/bin/install-deps
8431
8436
  - tracks/pony/bin/test-exercises
8432
8437
  - tracks/pony/config.json
8438
+ - tracks/pony/config/exercise_readme.go.tmpl
8433
8439
  - tracks/pony/docs/ABOUT.md
8434
8440
  - tracks/pony/docs/EXERCISE_README_INSERT.md
8435
8441
  - tracks/pony/docs/INSTALLATION.md
8436
8442
  - tracks/pony/docs/LEARNING.md
8437
8443
  - tracks/pony/docs/RESOURCES.md
8438
8444
  - tracks/pony/docs/TESTS.md
8445
+ - tracks/pony/exercises/anagram/README.md
8439
8446
  - tracks/pony/exercises/anagram/example.pony
8440
8447
  - tracks/pony/exercises/anagram/test.pony
8448
+ - tracks/pony/exercises/atbash-cipher/README.md
8441
8449
  - tracks/pony/exercises/atbash-cipher/example.pony
8442
8450
  - tracks/pony/exercises/atbash-cipher/test.pony
8451
+ - tracks/pony/exercises/beer-song/README.md
8443
8452
  - tracks/pony/exercises/beer-song/example.pony
8444
8453
  - tracks/pony/exercises/beer-song/test.pony
8454
+ - tracks/pony/exercises/bob/README.md
8445
8455
  - tracks/pony/exercises/bob/example.pony
8446
8456
  - tracks/pony/exercises/bob/test.pony
8457
+ - tracks/pony/exercises/difference-of-squares/README.md
8447
8458
  - tracks/pony/exercises/difference-of-squares/example.pony
8448
8459
  - tracks/pony/exercises/difference-of-squares/test.pony
8460
+ - tracks/pony/exercises/hamming/README.md
8449
8461
  - tracks/pony/exercises/hamming/example.pony
8450
8462
  - tracks/pony/exercises/hamming/test.pony
8463
+ - tracks/pony/exercises/hello-world/README.md
8451
8464
  - tracks/pony/exercises/hello-world/example.pony
8452
8465
  - tracks/pony/exercises/hello-world/test.pony
8466
+ - tracks/pony/exercises/leap/README.md
8453
8467
  - tracks/pony/exercises/leap/example.pony
8454
8468
  - tracks/pony/exercises/leap/test.pony
8469
+ - tracks/pony/exercises/pascals-triangle/README.md
8455
8470
  - tracks/pony/exercises/pascals-triangle/example.pony
8456
8471
  - tracks/pony/exercises/pascals-triangle/test.pony
8472
+ - tracks/pony/exercises/rna-transcription/README.md
8457
8473
  - tracks/pony/exercises/rna-transcription/example.pony
8458
8474
  - tracks/pony/exercises/rna-transcription/test.pony
8475
+ - tracks/pony/exercises/roman-numerals/README.md
8459
8476
  - tracks/pony/exercises/roman-numerals/example.pony
8460
8477
  - tracks/pony/exercises/roman-numerals/test.pony
8461
8478
  - tracks/pony/img/icon.png
@@ -9251,6 +9268,7 @@ files:
9251
9268
  - tracks/ruby/bin/setup-git-hoooks
9252
9269
  - tracks/ruby/config.json
9253
9270
  - tracks/ruby/config/exercise_readme.go.tmpl
9271
+ - tracks/ruby/config/maintainers.json
9254
9272
  - tracks/ruby/docs/24pullrequests.md
9255
9273
  - tracks/ruby/docs/ABOUT.md
9256
9274
  - tracks/ruby/docs/EXERCISE_README_INSERT.md
@@ -9533,6 +9551,10 @@ files:
9533
9551
  - tracks/ruby/exercises/roman-numerals/.meta/solutions/roman_numerals.rb
9534
9552
  - tracks/ruby/exercises/roman-numerals/README.md
9535
9553
  - tracks/ruby/exercises/roman-numerals/roman_numerals_test.rb
9554
+ - tracks/ruby/exercises/rotational-cipher/.meta/.version
9555
+ - tracks/ruby/exercises/rotational-cipher/.meta/generator/rotational_cipher_case.rb
9556
+ - tracks/ruby/exercises/rotational-cipher/.meta/solutions/rotational_cipher.rb
9557
+ - tracks/ruby/exercises/rotational-cipher/rotational_cipher_test.rb
9536
9558
  - tracks/ruby/exercises/run-length-encoding/.meta/.version
9537
9559
  - tracks/ruby/exercises/run-length-encoding/.meta/generator/run_length_encoding_case.rb
9538
9560
  - tracks/ruby/exercises/run-length-encoding/.meta/solutions/run_length_encoding.rb