trackler 2.1.0.41 → 2.1.0.42
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/fixtures/tracks/fake/docs/STRAY.md +1 -0
- data/lib/trackler/doc_file.rb +88 -0
- data/lib/trackler/track.rb +6 -40
- data/lib/trackler/version.rb +1 -1
- data/tracks/bash/README.md +2 -2
- data/tracks/bash/config.json +1 -1
- data/tracks/c/README.md +1 -1
- data/tracks/c/config.json +1 -1
- data/tracks/ceylon/README.md +4 -4
- data/tracks/ceylon/config.json +1 -1
- data/tracks/clojure/README.org +3 -3
- data/tracks/clojure/config.json +1 -1
- data/tracks/cpp/README.md +2 -2
- data/tracks/cpp/config.json +1 -1
- data/tracks/cpp/docs/INSTALLATION.md +2 -2
- data/tracks/crystal/config.json +1 -1
- data/tracks/csharp/config.json +1 -1
- data/tracks/delphi/README.md +2 -2
- data/tracks/delphi/config.json +1 -1
- data/tracks/delphi/exercises/bowling/uBowlingTests.pas +14 -14
- data/tracks/ecmascript/config.json +1 -1
- data/tracks/elisp/README.org +4 -4
- data/tracks/elisp/config.json +1 -1
- data/tracks/elixir/README.md +3 -3
- data/tracks/elixir/config.json +1 -1
- data/tracks/erlang/README.md +2 -2
- data/tracks/erlang/config.json +2 -2
- data/tracks/factor/README.md +9 -9
- data/tracks/factor/config.json +1 -1
- data/tracks/fsharp/config.json +1 -1
- data/tracks/go/README.md +16 -16
- data/tracks/go/config.json +1 -1
- data/tracks/go/exercises/gigasecond/gigasecond_test.go +2 -2
- data/tracks/go/gen/gen.go +2 -2
- data/tracks/haskell/.gitignore +1 -1
- data/tracks/haskell/README.md +12 -8
- data/tracks/haskell/config.json +1 -1
- data/tracks/haskell/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/idris/README.md +1 -1
- data/tracks/idris/config.json +1 -1
- data/tracks/java/POLICIES.md +7 -7
- data/tracks/java/README.md +7 -7
- data/tracks/java/bin/journey-test.sh +1 -1
- data/tracks/java/config.json +1 -1
- data/tracks/java/docs/MAINTAINING.md +3 -20
- data/tracks/java/docs/TESTS.md +3 -3
- data/tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java +23 -20
- data/tracks/java/exercises/hello-world/GETTING_STARTED.md +1 -1
- data/tracks/java/exercises/hello-world/TUTORIAL.md +2 -2
- data/tracks/javascript/config.json +1 -1
- data/tracks/julia/.travis.yml +0 -2
- data/tracks/julia/config.json +9 -0
- data/tracks/julia/exercises/custom-set/example.jl +1 -1
- data/tracks/julia/exercises/luhn/example.jl +1 -1
- data/tracks/julia/exercises/robot-name/HINTS.md +17 -0
- data/tracks/julia/exercises/robot-name/example.jl +14 -0
- data/tracks/julia/exercises/robot-name/robot-name.jl +8 -0
- data/tracks/julia/exercises/robot-name/runtests.jl +69 -0
- data/tracks/kotlin/README.md +7 -7
- data/tracks/kotlin/config.json +1 -1
- data/tracks/kotlin/docs/TESTS.md +3 -3
- data/tracks/kotlin/exercises/hello-world/GETTING_STARTED.md +1 -1
- data/tracks/kotlin/exercises/hello-world/TUTORIAL.md +1 -1
- data/tracks/lfe/README.md +2 -2
- data/tracks/lfe/config.json +1 -1
- data/tracks/lisp/README.md +1 -1
- data/tracks/lisp/config.json +2 -2
- data/tracks/lua/README.md +9 -9
- data/tracks/lua/config.json +1 -1
- data/tracks/lua/exercises/hamming/hamming_spec.lua +15 -7
- data/tracks/lua/exercises/raindrops/raindrops_spec.lua +46 -14
- data/tracks/mips/config.json +1 -1
- data/tracks/objective-c/Dangerfile +1 -1
- data/tracks/objective-c/README.md +1 -1
- data/tracks/objective-c/config.json +1 -1
- data/tracks/ocaml/README.md +2 -2
- data/tracks/ocaml/config.json +1 -1
- data/tracks/ocaml/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/ocaml/tools/test-generator/README.md +2 -2
- data/tracks/perl5/README.md +1 -1
- data/tracks/perl5/config.json +1 -1
- data/tracks/perl6/README.md +2 -2
- data/tracks/perl6/config.json +1 -1
- data/tracks/perl6/exercises/all-your-base/all-your-base.t +43 -32
- data/tracks/perl6/exercises/all-your-base/example.yaml +19 -9
- data/tracks/php/config.json +1 -1
- data/tracks/pony/README.md +2 -2
- data/tracks/pony/config.json +1 -1
- data/tracks/powershell/README.md +1 -1
- data/tracks/powershell/config.json +1 -1
- data/tracks/purescript/README.md +5 -5
- data/tracks/purescript/config.json +1 -1
- data/tracks/r/README.md +3 -3
- data/tracks/r/config.json +1 -1
- data/tracks/racket/README.md +2 -2
- data/tracks/racket/config.json +1 -1
- data/tracks/ruby/README.md +9 -9
- data/tracks/ruby/config.json +1 -1
- data/tracks/rust/config.json +1 -1
- data/tracks/rust/exercises/gigasecond/src/lib.rs +7 -0
- data/tracks/rust/exercises/protein-translation/example.rs +11 -22
- data/tracks/rust/exercises/protein-translation/tests/proteins.rs +56 -36
- data/tracks/scala/config.json +1 -1
- data/tracks/scala/exercises/all-your-base/src/test/scala/AllYourBaseTest.scala +46 -64
- data/tracks/scala/exercises/rna-transcription/example.scala +1 -3
- data/tracks/scala/exercises/rna-transcription/src/test/scala/RnaTranscriptionTest.scala +19 -23
- data/tracks/scala/exercises/scrabble-score/example.scala +2 -2
- data/tracks/scala/exercises/scrabble-score/src/test/scala/ScrabbleScoreTest.scala +37 -16
- data/tracks/scala/testgen/src/main/scala/AllYourBaseTestGenerator.scala +32 -42
- data/tracks/scala/testgen/src/main/scala/RnaTranscriptionTestGenerator.scala +34 -0
- data/tracks/scala/testgen/src/main/scala/ScrabbleScoreTestGenerator.scala +15 -0
- data/tracks/sml/README.md +1 -3
- data/tracks/sml/config.json +1 -1
- data/tracks/sml/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/swift/config.json +1 -1
- data/tracks/typescript/README.md +1 -1
- data/tracks/typescript/config.json +1 -1
- data/tracks/vimscript/README.md +5 -5
- data/tracks/vimscript/config.json +8 -1
- data/tracks/vimscript/exercises/largest-series-product/example.vim +31 -0
- data/tracks/vimscript/exercises/largest-series-product/largest_series_product.vader +95 -0
- data/tracks/vimscript/exercises/largest-series-product/largest_series_product.vim +17 -0
- metadata +13 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f89022dff9de539f6c5ed2e7f627090fd42e251
|
|
4
|
+
data.tar.gz: 31ec9e2242d4cea1ec24449d40d39d4d2a5d45c8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7ef0817e04b9a83672a9f7ec38ebe2eba7a65ab077b7f0b8ebeb73849478f3601f47f3f72e321cb9a8ec2b282f35d63a7eb9a14d5efcbfdd131ebd3e3f19474a
|
|
7
|
+
data.tar.gz: f23e60366c12452efaea36a47bac1232b52fdacd9231e05629cb2841a1c59b629d8fd23a6a00c080ee5aa400ac768df3b89b5df6531d87db9cf60e3efb4a82d9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+

|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
class DocFile
|
|
2
|
+
DEFAULT_IMAGE_PATH = "/docs/img"
|
|
3
|
+
|
|
4
|
+
def self.find(basename:, track_dir:)
|
|
5
|
+
dir = File.join(track_dir, "docs")
|
|
6
|
+
|
|
7
|
+
[
|
|
8
|
+
MarkdownFile.new(basename: basename, docs_dir: dir),
|
|
9
|
+
OrgmodeFile.new(basename: basename, docs_dir: dir),
|
|
10
|
+
].detect(&:exist?) || NullFile.new(basename)
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
attr_reader :basename, :dir
|
|
14
|
+
def initialize(basename:, docs_dir:)
|
|
15
|
+
@basename = basename
|
|
16
|
+
@dir = docs_dir
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def render(image_path: DEFAULT_IMAGE_PATH)
|
|
20
|
+
body.gsub(img_src, img_dst(image_path))
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def name
|
|
24
|
+
"%s.%s" % [basename, extension]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def extension
|
|
28
|
+
"md"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def exist?
|
|
32
|
+
File.exist?(path)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def body
|
|
38
|
+
File.read(path)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def path
|
|
42
|
+
"%s/%s" % [dir, name]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def img_src
|
|
46
|
+
Regexp.new("]\\(%s" % DEFAULT_IMAGE_PATH)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def img_dst(image_path)
|
|
50
|
+
"](%s" % image_path.gsub(Regexp.new("/$"), "")
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class OrgmodeFile < DocFile
|
|
55
|
+
def body
|
|
56
|
+
Orgmode::Parser.new(File.read(path)).to_markdown
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def extension
|
|
60
|
+
"org"
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
class MarkdownFile < DocFile
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class NullFile
|
|
68
|
+
attr_reader :basename
|
|
69
|
+
def initialize(basename)
|
|
70
|
+
@basename = basename
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def render(image_path:"")
|
|
74
|
+
""
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def name
|
|
78
|
+
"%s.%s" % [basename, extension]
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def extension
|
|
82
|
+
"md" # default for missing files
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def exist?
|
|
86
|
+
false
|
|
87
|
+
end
|
|
88
|
+
end
|
data/lib/trackler/track.rb
CHANGED
|
@@ -8,7 +8,7 @@ module Trackler
|
|
|
8
8
|
# Track is a collection of exercises in a given language.
|
|
9
9
|
class Track
|
|
10
10
|
TOPICS = %w(about installation tests learning resources)
|
|
11
|
-
DEFAULT_IMAGE_PATH =
|
|
11
|
+
DEFAULT_IMAGE_PATH = DocFile::DEFAULT_IMAGE_PATH
|
|
12
12
|
|
|
13
13
|
Image = Struct.new(:path) do
|
|
14
14
|
def exists?
|
|
@@ -100,9 +100,9 @@ module Trackler
|
|
|
100
100
|
end
|
|
101
101
|
|
|
102
102
|
def doc_format
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
TOPICS.map { |topic|
|
|
104
|
+
DocFile.find(basename: topic.upcase, track_dir: dir).extension
|
|
105
|
+
}.partition(&:to_s).max_by(&:size).first
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def global_zip
|
|
@@ -119,19 +119,11 @@ module Trackler
|
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def hints
|
|
122
|
-
|
|
123
|
-
File.read(track_hints_filename)
|
|
124
|
-
else
|
|
125
|
-
""
|
|
126
|
-
end
|
|
122
|
+
docfile = DocFile.find(basename: 'EXERCISE_README_INSERT', track_dir: dir).render
|
|
127
123
|
end
|
|
128
124
|
|
|
129
125
|
private
|
|
130
126
|
|
|
131
|
-
def track_hints_filename
|
|
132
|
-
File.join(dir, 'docs', 'EXERCISE_README_INSERT.md')
|
|
133
|
-
end
|
|
134
|
-
|
|
135
127
|
def active_slugs
|
|
136
128
|
(config["exercises"] || []).map { |ex| ex["slug"] }
|
|
137
129
|
end
|
|
@@ -144,13 +136,6 @@ module Trackler
|
|
|
144
136
|
config["deprecated"] || []
|
|
145
137
|
end
|
|
146
138
|
|
|
147
|
-
def most_popular_format(path)
|
|
148
|
-
formats = Dir.glob(path).map do |filename|
|
|
149
|
-
File.extname(filename).sub(/^\./, '')
|
|
150
|
-
end
|
|
151
|
-
formats.max_by { |format| formats.count(format) }
|
|
152
|
-
end
|
|
153
|
-
|
|
154
139
|
def config
|
|
155
140
|
@config ||= JSON.parse(File.read(config_filename))
|
|
156
141
|
end
|
|
@@ -159,35 +144,16 @@ module Trackler
|
|
|
159
144
|
File.join(dir, "config.json")
|
|
160
145
|
end
|
|
161
146
|
|
|
162
|
-
def document_contents(topic)
|
|
163
|
-
filename = document_filename(topic)
|
|
164
|
-
case filename
|
|
165
|
-
when /\.md$/
|
|
166
|
-
File.read(filename)
|
|
167
|
-
when /\.org$/
|
|
168
|
-
Orgmode::Parser.new(File.read(filename)).to_markdown
|
|
169
|
-
else
|
|
170
|
-
''
|
|
171
|
-
end
|
|
172
|
-
end
|
|
173
|
-
|
|
174
147
|
def docs_by_topic(image_path)
|
|
175
|
-
src = Regexp.new("]\\(%s" % DEFAULT_IMAGE_PATH)
|
|
176
|
-
dst = "](%s" % image_path.gsub(Regexp.new("/$"), "")
|
|
177
148
|
Hash[
|
|
178
149
|
TOPICS.zip(
|
|
179
150
|
TOPICS.map { |topic|
|
|
180
|
-
|
|
151
|
+
DocFile.find(basename: topic.upcase, track_dir: dir).render(image_path: image_path)
|
|
181
152
|
}
|
|
182
153
|
)
|
|
183
154
|
]
|
|
184
155
|
end
|
|
185
156
|
|
|
186
|
-
def document_filename(topic)
|
|
187
|
-
path = File.join(dir, "docs", topic.upcase)
|
|
188
|
-
Dir.glob("%s.*" % path).sort.first
|
|
189
|
-
end
|
|
190
|
-
|
|
191
157
|
def svg_icon
|
|
192
158
|
@svg_icon ||= Image.new(File.join(dir, "img/icon.svg"))
|
|
193
159
|
end
|
data/lib/trackler/version.rb
CHANGED
data/tracks/bash/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Exercism Bash Track
|
|
2
2
|
|
|
3
|
-
[](https://gitter.im/exercism/bash?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
4
4
|
|
|
5
5
|
Exercism Exercises in Bash
|
|
6
6
|
|
data/tracks/bash/config.json
CHANGED
data/tracks/c/README.md
CHANGED
data/tracks/c/config.json
CHANGED
data/tracks/ceylon/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Exercism Ceylon Track
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/exercism/ceylon)
|
|
4
4
|
|
|
5
5
|
Exercism problems in Ceylon.
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ Exercism problems in Ceylon.
|
|
|
9
9
|
### Asking for help
|
|
10
10
|
|
|
11
11
|
If you're ever unsure about how to help, don't worry!
|
|
12
|
-
You can just ask in the [Exercism Gitter support](https://gitter.im/exercism/support) channel or by creating an issue [for the Ceylon track](https://github.com/exercism/
|
|
12
|
+
You can just ask in the [Exercism Gitter support](https://gitter.im/exercism/support) channel or by creating an issue [for the Ceylon track](https://github.com/exercism/ceylon/issues/new) and we are happy to help you!
|
|
13
13
|
|
|
14
14
|
### How to contribute
|
|
15
15
|
|
|
@@ -70,7 +70,7 @@ However, if there is any Ceylon-specific information that you would like appende
|
|
|
70
70
|
|
|
71
71
|
### Running the tests
|
|
72
72
|
|
|
73
|
-
As mentioned, [Travis CI](https://travis-ci.org/exercism/
|
|
73
|
+
As mentioned, [Travis CI](https://travis-ci.org/exercism/ceylon) runs our tests to ensure that our exercises are solvable.
|
|
74
74
|
The tests are run on all pull requests (PRs), and we should strive to only merge PRs for which the tests are passing.
|
|
75
75
|
|
|
76
76
|
It is possible to run these tests locally as well.
|
data/tracks/ceylon/config.json
CHANGED
data/tracks/clojure/README.org
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
#+TITLE:
|
|
1
|
+
#+TITLE: Exercism Clojure Track
|
|
2
2
|
|
|
3
3
|
#+ATTR_HTML: :alt Build Status
|
|
4
|
-
[[https://travis-ci.org/exercism/
|
|
4
|
+
[[https://travis-ci.org/exercism/clojure][https://travis-ci.org/exercism/clojure.svg]]
|
|
5
5
|
|
|
6
6
|
Exercism exercises in Clojure
|
|
7
7
|
|
|
8
8
|
* Contributing Guide
|
|
9
9
|
Please see the [[https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data][contributing guide]].
|
|
10
10
|
|
|
11
|
-
*** [[https://github.com/exercism/
|
|
11
|
+
*** [[https://github.com/exercism/clojure/tree/master/img/icon.png][Clojure icon]]
|
|
12
12
|
The Clojure logo is owned by Rich Hickey.
|
|
13
13
|
We are using it to identify the Clojure language itself, not any part of Exercism, which we believe to be admissible under fair use.
|
|
14
14
|
The version of the logo that we are using is a black/white adaptation of the logo found on http://clojure.org.
|
data/tracks/clojure/config.json
CHANGED
data/tracks/cpp/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# C++
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/exercism/cpp)
|
|
4
4
|
|
|
5
5
|
Exercism Exercises in C++
|
|
6
6
|
|
data/tracks/cpp/config.json
CHANGED
|
@@ -78,7 +78,7 @@ not worry about setting up a build for each exercise.
|
|
|
78
78
|
|
|
79
79
|
Getting a portable build isn't easy and requires access to many kinds of
|
|
80
80
|
systems. If you encounter any problems with the supplied CMake recipe,
|
|
81
|
-
please [report the issue](https://github.com/exercism/
|
|
81
|
+
please [report the issue](https://github.com/exercism/cpp/issues) so we can
|
|
82
82
|
improve the CMake support.
|
|
83
83
|
|
|
84
84
|
[CMake 2.8.11 or later](http://www.cmake.org/) is required to use the provided build recipe.
|
|
@@ -96,7 +96,7 @@ boost libraries Boost.Test, Boost.DateTime and Boost.Regex, or you will
|
|
|
96
96
|
need to download from source and build the library yourself.
|
|
97
97
|
|
|
98
98
|
If you are having difficulties installing Boost for use with exercism,
|
|
99
|
-
[ask for help](https://github.com/exercism/
|
|
99
|
+
[ask for help](https://github.com/exercism/cpp/issues).
|
|
100
100
|
|
|
101
101
|
#### Linux
|
|
102
102
|
|
data/tracks/crystal/config.json
CHANGED
data/tracks/csharp/config.json
CHANGED
data/tracks/delphi/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Exercism Delphi Pascal Track
|
|
2
2
|
|
|
3
|
-
[](https://travis-ci.org/exercism/delphi)
|
|
4
4
|
|
|
5
5
|
Exercism exercises in Delphi Pascal.
|
|
6
6
|
|
data/tracks/delphi/config.json
CHANGED
|
@@ -70,31 +70,31 @@ type
|
|
|
70
70
|
|
|
71
71
|
[Test]
|
|
72
72
|
[Ignore]
|
|
73
|
-
procedure
|
|
73
|
+
procedure Rolls_cannot_score_negative_points;
|
|
74
74
|
|
|
75
75
|
[Test]
|
|
76
76
|
[Ignore]
|
|
77
|
-
procedure
|
|
77
|
+
procedure A_roll_cannot_score_more_than_10_points;
|
|
78
78
|
|
|
79
79
|
[Test]
|
|
80
80
|
[Ignore]
|
|
81
|
-
procedure
|
|
81
|
+
procedure Two_rolls_in_a_frame_cannot_score_more_than_10_points;
|
|
82
82
|
|
|
83
83
|
[Test]
|
|
84
84
|
[Ignore]
|
|
85
|
-
procedure
|
|
85
|
+
procedure Two_bonus_rolls_after_a_strike_in_the_last_frame_cannot_score_more_than_10_points;
|
|
86
86
|
|
|
87
87
|
[Test]
|
|
88
88
|
[Ignore]
|
|
89
|
-
procedure
|
|
89
|
+
procedure An_unstarted_game_cannot_be_scored;
|
|
90
90
|
|
|
91
91
|
[Test]
|
|
92
92
|
[Ignore]
|
|
93
|
-
procedure
|
|
93
|
+
procedure An_incomplete_game_cannot_be_scored;
|
|
94
94
|
|
|
95
95
|
[Test]
|
|
96
96
|
[Ignore]
|
|
97
|
-
procedure
|
|
97
|
+
procedure A_game_with_more_than_ten_frames_cannot_be_scored;
|
|
98
98
|
|
|
99
99
|
[Test]
|
|
100
100
|
[Ignore]
|
|
@@ -210,49 +210,49 @@ begin
|
|
|
210
210
|
assert.AreEqual(300, game.Score);
|
|
211
211
|
end;
|
|
212
212
|
|
|
213
|
-
procedure BowlingTests.
|
|
213
|
+
procedure BowlingTests.Rolls_cannot_score_negative_points;
|
|
214
214
|
var game: IBowlingGame;
|
|
215
215
|
begin
|
|
216
216
|
game := RollMany([-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], NewBowlingGame);
|
|
217
217
|
Assert.AreEqual(-1, game.Score);
|
|
218
218
|
end;
|
|
219
219
|
|
|
220
|
-
procedure BowlingTests.
|
|
220
|
+
procedure BowlingTests.A_roll_cannot_score_more_than_10_points;
|
|
221
221
|
var game: IBowlingGame;
|
|
222
222
|
begin
|
|
223
223
|
game := RollMany([11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], NewBowlingGame);
|
|
224
224
|
Assert.AreEqual(-1, game.Score);
|
|
225
225
|
end;
|
|
226
226
|
|
|
227
|
-
procedure BowlingTests.
|
|
227
|
+
procedure BowlingTests.Two_rolls_in_a_frame_cannot_score_more_than_10_points;
|
|
228
228
|
var game: IBowlingGame;
|
|
229
229
|
begin
|
|
230
230
|
game := RollMany([5, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], NewBowlingGame);
|
|
231
231
|
Assert.AreEqual(-1, game.Score);
|
|
232
232
|
end;
|
|
233
233
|
|
|
234
|
-
procedure BowlingTests.
|
|
234
|
+
procedure BowlingTests.Two_bonus_rolls_after_a_strike_in_the_last_frame_cannot_score_more_than_10_points;
|
|
235
235
|
var game: IBowlingGame;
|
|
236
236
|
begin
|
|
237
237
|
game := RollMany([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 5, 6], NewBowlingGame);
|
|
238
238
|
Assert.AreEqual(-1, game.Score);
|
|
239
239
|
end;
|
|
240
240
|
|
|
241
|
-
procedure BowlingTests.
|
|
241
|
+
procedure BowlingTests.An_unstarted_game_cannot_be_scored;
|
|
242
242
|
var game: IBowlingGame;
|
|
243
243
|
begin
|
|
244
244
|
game := RollMany([],NewBowlingGame);
|
|
245
245
|
Assert.AreEqual(-1, game.Score);
|
|
246
246
|
end;
|
|
247
247
|
|
|
248
|
-
procedure BowlingTests.
|
|
248
|
+
procedure BowlingTests.An_incomplete_game_cannot_be_scored;
|
|
249
249
|
var game: IBowlingGame;
|
|
250
250
|
begin
|
|
251
251
|
game := RollMany([0, 0], NewBowlingGame);
|
|
252
252
|
Assert.AreEqual(-1, game.Score);
|
|
253
253
|
end;
|
|
254
254
|
|
|
255
|
-
procedure BowlingTests.
|
|
255
|
+
procedure BowlingTests.A_game_with_more_than_ten_frames_cannot_be_scored;
|
|
256
256
|
var game: IBowlingGame;
|
|
257
257
|
begin
|
|
258
258
|
game := RollMany([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], NewBowlingGame);
|
data/tracks/elisp/README.org
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#+TITLE:
|
|
1
|
+
#+TITLE: elisp
|
|
2
2
|
#+AUTHOR: Jason Lewis
|
|
3
3
|
|
|
4
4
|
#+ATTR_HTML: :alt Build Status
|
|
5
|
-
[[https://travis-ci.org/exercism/
|
|
5
|
+
[[https://travis-ci.org/exercism/elisp][https://api.travis-ci.org/exercism/elisp.svg?branch=master]]
|
|
6
6
|
|
|
7
7
|
Exercism problems in Emacs Lisp.
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ information about contributing to existing problems and adding new problems.
|
|
|
17
17
|
|
|
18
18
|
*** Issues
|
|
19
19
|
|
|
20
|
-
Feel free to file any issues on the [[https://github.com/exercism/
|
|
20
|
+
Feel free to file any issues on the [[https://github.com/exercism/elisp/issues][elisp issue tracker]] for problems of
|
|
21
21
|
any size. Feel free to report typographical errors or poor wording for
|
|
22
22
|
example. You can greatly help improve the quality of the exercises by
|
|
23
23
|
filing reports of invalid solutions that pass tests or of valid solutions
|
|
@@ -25,7 +25,7 @@ that fail tests.
|
|
|
25
25
|
|
|
26
26
|
New exercises or changes to existing ones can be submitted via a pull
|
|
27
27
|
request. You will need a GitHub account and you will need to fork
|
|
28
|
-
[[https://github.com/exercism/
|
|
28
|
+
[[https://github.com/exercism/elisp][exercism/elisp]] to your account. See GitHub Help if you are unfamiliar
|
|
29
29
|
with the process.
|
|
30
30
|
|
|
31
31
|
|
data/tracks/elisp/config.json
CHANGED
data/tracks/elixir/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Exercism Elixir Track
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|
|
|
5
5
|
Exercism Exercises in Elixir
|
|
6
6
|
|
|
@@ -72,7 +72,7 @@ test "shouting" do
|
|
|
72
72
|
end
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
-
All the tests for
|
|
75
|
+
All the tests for Exercism Elixir Track exercises can be run from the top level of the repo
|
|
76
76
|
with `$ mix test`. Please run this command before submitting your PR. Watch out
|
|
77
77
|
for and correct any compiler warnings you may have introduced.
|
|
78
78
|
|
data/tracks/elixir/config.json
CHANGED
data/tracks/erlang/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Exercism Erlang Track
|
|
2
2
|
|
|
3
|
-
[](https://gitter.im/exercism/erlang?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
4
4
|
|
|
5
5
|
Exercism exercises in Erlang
|
|
6
6
|
|
data/tracks/erlang/config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"slug": "erlang",
|
|
3
3
|
"language": "Erlang",
|
|
4
|
-
"repository": "https://github.com/exercism/
|
|
4
|
+
"repository": "https://github.com/exercism/erlang",
|
|
5
5
|
"active": true,
|
|
6
6
|
"exercises": [
|
|
7
7
|
{
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"slug": "collatz-conjecture",
|
|
30
|
-
"topics":[
|
|
30
|
+
"topics": [
|
|
31
31
|
|
|
32
32
|
],
|
|
33
33
|
"difficulty": 1
|
data/tracks/factor/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Exercism Factor Track
|
|
2
2
|
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
[](https://travis-ci.org/exercism/factor)
|
|
6
6
|
|
|
7
7
|
Exercism problems in Factor.
|
|
8
8
|
|
|
@@ -33,8 +33,8 @@ Here's what you need to do to start working with the Factor code in the `exercis
|
|
|
33
33
|
|
|
34
34
|
2. Test an exercise's example code with:
|
|
35
35
|
```
|
|
36
|
-
|
|
37
|
-
working directory OK: /home/you/git/
|
|
36
|
+
factor (master) $ factor -run=exericsm.testing hello-world
|
|
37
|
+
working directory OK: /home/you/git/factor is a dev-env
|
|
38
38
|
config.json and exercises OK
|
|
39
39
|
|
|
40
40
|
testing exercise: hello-world
|
|
@@ -45,8 +45,8 @@ Here's what you need to do to start working with the Factor code in the `exercis
|
|
|
45
45
|
Alternatively, to run all tests in all exercise directories:
|
|
46
46
|
|
|
47
47
|
```
|
|
48
|
-
|
|
49
|
-
working directory OK: /home/you/git/
|
|
48
|
+
factor (master) $ factor -run=exericsm.testing run-all
|
|
49
|
+
working directory OK: /home/you/git/factor is a dev-env
|
|
50
50
|
config.json and exercises OK
|
|
51
51
|
|
|
52
52
|
testing exercise: hello-world
|
|
@@ -56,8 +56,8 @@ Here's what you need to do to start working with the Factor code in the `exercis
|
|
|
56
56
|
|
|
57
57
|
`config.json` is verified for logical integrity on each run. To only check `config.json`'s validity:
|
|
58
58
|
```
|
|
59
|
-
|
|
60
|
-
working directory OK: /home/you/git/
|
|
59
|
+
factor (master) $ factor -run=exericsm.testing VERIFY
|
|
60
|
+
working directory OK: /home/you/git/factor is a dev-env
|
|
61
61
|
config.json and exercises OK
|
|
62
62
|
```
|
|
63
63
|
If `config.json` is invalid, then an error will be thrown and tests will not run.
|
|
@@ -70,6 +70,6 @@ Here's what you need to do to start working with the Factor code in the `exercis
|
|
|
70
70
|
|
|
71
71
|
If you think you've found a factual or technical error, or you just have a question or suggestion about some part of the Markdown or Factor documentation, we'd :heart: you to open an issue or pull request.
|
|
72
72
|
|
|
73
|
-
### [Factor icon](https://github.com/exercism/
|
|
73
|
+
### [Factor icon](https://github.com/exercism/factor/tree/master/img/icon.png)
|
|
74
74
|
|
|
75
75
|
The Factor "Tyrannosaurus Rex" logo is owned by John Benediktsson. We have adapted it, changing the colour scheme, with his permission.
|