trackler 2.2.1.51 → 2.2.1.52
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/saddle-points/description.md +1 -1
- data/tracks/cfml/.gitattributes +19 -0
- data/tracks/cfml/config.json +180 -186
- data/tracks/cfml/tasks/FormatConfig.cfc +26 -0
- data/tracks/cfml/tasks/ScaffoldExercise.cfc +1 -1
- data/tracks/common-lisp/config.json +26 -9
- data/tracks/common-lisp/exercises/acronym/README.md +61 -0
- data/tracks/common-lisp/exercises/acronym/acronym-test.lisp +48 -0
- data/tracks/common-lisp/exercises/acronym/acronym.lisp +6 -0
- data/tracks/common-lisp/exercises/acronym/example.lisp +24 -0
- data/tracks/common-lisp/exercises/isogram/README.md +65 -0
- data/tracks/common-lisp/exercises/isogram/example.lisp +18 -0
- data/tracks/common-lisp/exercises/isogram/isogram-test.lisp +39 -0
- data/tracks/common-lisp/exercises/isogram/isogram.lisp +8 -0
- data/tracks/delphi/exercises/etl/README.md +1 -1
- data/tracks/delphi/exercises/rna-transcription/README.md +1 -1
- data/tracks/delphi/exercises/saddle-points/README.md +1 -1
- data/tracks/fsharp/exercises/all-your-base/AllYourBaseTest.fs +21 -21
- data/tracks/fsharp/exercises/kindergarten-garden/Example.fs +13 -14
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGarden.fs +1 -3
- data/tracks/fsharp/exercises/kindergarten-garden/KindergartenGardenTest.fs +9 -41
- data/tracks/fsharp/exercises/phone-number/PhoneNumberTest.fs +12 -12
- data/tracks/fsharp/exercises/rna-transcription/RnaTranscriptionTest.fs +8 -8
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulator.fs +3 -0
- data/tracks/fsharp/exercises/robot-simulator/RobotSimulatorTest.fs +129 -26
- data/tracks/fsharp/generators/Common.fs +10 -0
- data/tracks/fsharp/generators/Exercise.fs +5 -1
- data/tracks/fsharp/generators/Generators.fs +122 -33
- data/tracks/fsharp/generators/Output.fs +6 -1
- data/tracks/haskell/exercises/crypto-square/README.md +6 -4
- data/tracks/haskell/exercises/kindergarten-garden/README.md +10 -10
- data/tracks/haskell/exercises/saddle-points/README.md +1 -1
- data/tracks/haskell/exercises/space-age/README.md +1 -1
- data/tracks/java/config.json +8 -2
- data/tracks/java/exercises/queen-attack/.meta/src/reference/java/BoardCoordinate.java +12 -12
- data/tracks/java/exercises/queen-attack/.meta/src/reference/java/QueenAttackCalculator.java +14 -14
- data/tracks/java/exercises/queen-attack/.meta/version +1 -1
- data/tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java +11 -11
- data/tracks/javascript/exercises/prime-factors/example.js +10 -9
- data/tracks/julia/config.json +12 -0
- data/tracks/julia/exercises/run-length-encoding/README.md +31 -0
- data/tracks/julia/exercises/run-length-encoding/example.jl +22 -0
- data/tracks/julia/exercises/run-length-encoding/run-length-encoding.jl +7 -0
- data/tracks/julia/exercises/run-length-encoding/runtests.jl +29 -0
- data/tracks/objective-c/README.md +79 -1
- data/tracks/ocaml/config.json +430 -433
- data/tracks/ocaml/config/maintainers.json +11 -11
- data/tracks/php/config.json +16 -0
- data/tracks/php/exercises/all-your-base/README.md +31 -0
- data/tracks/php/exercises/all-your-base/all-your-base_test.php +135 -0
- data/tracks/php/exercises/all-your-base/example.php +27 -0
- data/tracks/php/exercises/series/README.md +21 -0
- data/tracks/php/exercises/series/example.php +15 -0
- data/tracks/php/exercises/series/series_test.php +64 -0
- data/tracks/python/README.md +1 -1
- data/tracks/python/config.json +4 -1
- data/tracks/python/exercises/forth/forth.py +4 -0
- data/tracks/python/exercises/forth/forth_test.py +1 -1
- data/tracks/python/exercises/markdown/example.py +1 -1
- data/tracks/python/exercises/markdown/markdown_test.py +3 -3
- data/tracks/ruby/exercises/two-bucket/.meta/.version +1 -1
- data/tracks/ruby/exercises/two-bucket/.meta/solutions/two_bucket.rb +23 -3
- data/tracks/ruby/exercises/two-bucket/two_bucket_test.rb +4 -4
- metadata +22 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module BookKeeping
|
|
2
|
-
VERSION =
|
|
2
|
+
VERSION = 4
|
|
3
3
|
end
|
|
4
4
|
|
|
5
5
|
class TwoBucket
|
|
@@ -15,11 +15,15 @@ class TwoBucket
|
|
|
15
15
|
def moves
|
|
16
16
|
if @start_bucket == 'one'
|
|
17
17
|
@levels = [@first_size, 0]
|
|
18
|
-
|
|
18
|
+
strategy = method(:start_from_first)
|
|
19
19
|
else
|
|
20
20
|
@levels = [0, @second_size]
|
|
21
|
-
|
|
21
|
+
strategy = method(:start_from_second)
|
|
22
22
|
end
|
|
23
|
+
if other_bucket_matches_goal
|
|
24
|
+
strategy = method(:fill_other_bucket)
|
|
25
|
+
end
|
|
26
|
+
solve strategy
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
private
|
|
@@ -68,6 +72,22 @@ class TwoBucket
|
|
|
68
72
|
end
|
|
69
73
|
end
|
|
70
74
|
|
|
75
|
+
def fill_other_bucket
|
|
76
|
+
if first_bucket_empty?
|
|
77
|
+
fill_first_bucket
|
|
78
|
+
else
|
|
79
|
+
fill_second_bucket
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def other_bucket_matches_goal
|
|
84
|
+
if @start_bucket == 'one'
|
|
85
|
+
@second_size == @goal
|
|
86
|
+
else
|
|
87
|
+
@first_size == @goal
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
71
91
|
def first_bucket_empty?
|
|
72
92
|
@levels.first == 0
|
|
73
93
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require 'minitest/autorun'
|
|
2
2
|
require_relative 'two_bucket'
|
|
3
3
|
|
|
4
|
-
# Common test data version: 1.
|
|
4
|
+
# Common test data version: 1.2.0 8aa11e8
|
|
5
5
|
class TwoBucketTest < Minitest::Test
|
|
6
6
|
def test_bucket_one_size_3_bucket_two_size_5_goal_1_start_with_bucket_one
|
|
7
7
|
# skip
|
|
@@ -46,9 +46,9 @@ class TwoBucketTest < Minitest::Test
|
|
|
46
46
|
def test_bucket_one_size_2_bucket_two_size_3_goal_3_start_with_bucket_one
|
|
47
47
|
skip
|
|
48
48
|
two_bucket = TwoBucket.new(2, 3, 3, 'one')
|
|
49
|
-
assert_equal
|
|
49
|
+
assert_equal 2, two_bucket.moves
|
|
50
50
|
assert_equal 'two', two_bucket.goal_bucket
|
|
51
|
-
assert_equal
|
|
51
|
+
assert_equal 2, two_bucket.other_bucket
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
# Problems in exercism evolve over time, as we find better ways to ask
|
|
@@ -70,6 +70,6 @@ class TwoBucketTest < Minitest::Test
|
|
|
70
70
|
|
|
71
71
|
def test_bookkeeping
|
|
72
72
|
skip
|
|
73
|
-
assert_equal
|
|
73
|
+
assert_equal 4, BookKeeping::VERSION
|
|
74
74
|
end
|
|
75
75
|
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.
|
|
4
|
+
version: 2.2.1.52
|
|
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-10-
|
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubyzip
|
|
@@ -1032,6 +1032,7 @@ files:
|
|
|
1032
1032
|
- tracks/ceylon/exercises/sieve/source/sieve/module.ceylon
|
|
1033
1033
|
- tracks/ceylon/img/icon.png
|
|
1034
1034
|
- tracks/cfml/.git
|
|
1035
|
+
- tracks/cfml/.gitattributes
|
|
1035
1036
|
- tracks/cfml/.gitignore
|
|
1036
1037
|
- tracks/cfml/.travis.yml
|
|
1037
1038
|
- tracks/cfml/CONTRIBUTING.md
|
|
@@ -1299,6 +1300,7 @@ files:
|
|
|
1299
1300
|
- tracks/cfml/exercises/word-count/box.json
|
|
1300
1301
|
- tracks/cfml/exercises/word-count/index.cfm
|
|
1301
1302
|
- tracks/cfml/img/icon.png
|
|
1303
|
+
- tracks/cfml/tasks/FormatConfig.cfc
|
|
1302
1304
|
- tracks/cfml/tasks/GenerateTests.cfc
|
|
1303
1305
|
- tracks/cfml/tasks/ScaffoldExercise.cfc
|
|
1304
1306
|
- tracks/cfml/tasks/TestAllSolutions.cfc
|
|
@@ -1700,6 +1702,10 @@ files:
|
|
|
1700
1702
|
- tracks/common-lisp/docs/RESOURCES.md
|
|
1701
1703
|
- tracks/common-lisp/docs/SNIPPET.txt
|
|
1702
1704
|
- tracks/common-lisp/docs/TESTS.md
|
|
1705
|
+
- tracks/common-lisp/exercises/acronym/README.md
|
|
1706
|
+
- tracks/common-lisp/exercises/acronym/acronym-test.lisp
|
|
1707
|
+
- tracks/common-lisp/exercises/acronym/acronym.lisp
|
|
1708
|
+
- tracks/common-lisp/exercises/acronym/example.lisp
|
|
1703
1709
|
- tracks/common-lisp/exercises/allergies/README.md
|
|
1704
1710
|
- tracks/common-lisp/exercises/allergies/allergies-test.lisp
|
|
1705
1711
|
- tracks/common-lisp/exercises/allergies/allergies.lisp
|
|
@@ -1759,6 +1765,10 @@ files:
|
|
|
1759
1765
|
- tracks/common-lisp/exercises/hello-world/example.lisp
|
|
1760
1766
|
- tracks/common-lisp/exercises/hello-world/hello-world-test.lisp
|
|
1761
1767
|
- tracks/common-lisp/exercises/hello-world/hello-world.lisp
|
|
1768
|
+
- tracks/common-lisp/exercises/isogram/README.md
|
|
1769
|
+
- tracks/common-lisp/exercises/isogram/example.lisp
|
|
1770
|
+
- tracks/common-lisp/exercises/isogram/isogram-test.lisp
|
|
1771
|
+
- tracks/common-lisp/exercises/isogram/isogram.lisp
|
|
1762
1772
|
- tracks/common-lisp/exercises/leap/README.md
|
|
1763
1773
|
- tracks/common-lisp/exercises/leap/example.lisp
|
|
1764
1774
|
- tracks/common-lisp/exercises/leap/leap-test.lisp
|
|
@@ -7675,6 +7685,10 @@ files:
|
|
|
7675
7685
|
- tracks/julia/exercises/rotational-cipher/example.jl
|
|
7676
7686
|
- tracks/julia/exercises/rotational-cipher/rotational-cipher.jl
|
|
7677
7687
|
- tracks/julia/exercises/rotational-cipher/runtests.jl
|
|
7688
|
+
- tracks/julia/exercises/run-length-encoding/README.md
|
|
7689
|
+
- tracks/julia/exercises/run-length-encoding/example.jl
|
|
7690
|
+
- tracks/julia/exercises/run-length-encoding/run-length-encoding.jl
|
|
7691
|
+
- tracks/julia/exercises/run-length-encoding/runtests.jl
|
|
7678
7692
|
- tracks/julia/exercises/scrabble-score/README.md
|
|
7679
7693
|
- tracks/julia/exercises/scrabble-score/example.jl
|
|
7680
7694
|
- tracks/julia/exercises/scrabble-score/runtests.jl
|
|
@@ -9683,6 +9697,9 @@ files:
|
|
|
9683
9697
|
- tracks/php/exercises/acronym/README.md
|
|
9684
9698
|
- tracks/php/exercises/acronym/acronym_test.php
|
|
9685
9699
|
- tracks/php/exercises/acronym/example.php
|
|
9700
|
+
- tracks/php/exercises/all-your-base/README.md
|
|
9701
|
+
- tracks/php/exercises/all-your-base/all-your-base_test.php
|
|
9702
|
+
- tracks/php/exercises/all-your-base/example.php
|
|
9686
9703
|
- tracks/php/exercises/allergies/README.md
|
|
9687
9704
|
- tracks/php/exercises/allergies/allergies_test.php
|
|
9688
9705
|
- tracks/php/exercises/allergies/example.php
|
|
@@ -9818,6 +9835,9 @@ files:
|
|
|
9818
9835
|
- tracks/php/exercises/scrabble-score/README.md
|
|
9819
9836
|
- tracks/php/exercises/scrabble-score/example.php
|
|
9820
9837
|
- tracks/php/exercises/scrabble-score/scrabble-score_test.php
|
|
9838
|
+
- tracks/php/exercises/series/README.md
|
|
9839
|
+
- tracks/php/exercises/series/example.php
|
|
9840
|
+
- tracks/php/exercises/series/series_test.php
|
|
9821
9841
|
- tracks/php/exercises/sieve/README.md
|
|
9822
9842
|
- tracks/php/exercises/sieve/example.php
|
|
9823
9843
|
- tracks/php/exercises/sieve/sieve_test.php
|