trackler 2.0.0.3 → 2.0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/CONTRIBUTING.md +1 -1
- data/common/README.md +4 -4
- data/common/exercises/bowling/canonical-data.json +8 -0
- data/common/exercises/hello-world/description.md +1 -1
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/.gitignore +1 -0
- data/tracks/c/bin/run-tests +3 -0
- data/tracks/c/config.json +9 -0
- data/tracks/c/exercises/clock/makefile +16 -0
- data/tracks/c/exercises/clock/src/clock.h +11 -0
- data/tracks/c/exercises/clock/src/example.c +31 -0
- data/tracks/c/exercises/clock/test/test_clock.c +489 -0
- data/tracks/c/exercises/clock/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/clock/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/clock/test/vendor/unity_internals.h +701 -0
- data/tracks/coldfusion/config.json +2 -1
- data/tracks/coldfusion/img/icon.png +0 -0
- data/tracks/crystal/Makefile +11 -15
- data/tracks/crystal/SETUP.md +1 -1
- data/tracks/crystal/docs/LEARNING.md +5 -3
- data/tracks/crystal/docs/TESTS.md +24 -3
- data/tracks/crystal/exercises/anagram/{anagram_spec.cr → spec/anagram_spec.cr} +1 -1
- data/tracks/crystal/exercises/anagram/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/atbash-cipher/{atbash_cipher_spec.cr → spec/atbash_cipher_spec.cr} +1 -1
- data/tracks/crystal/exercises/atbash-cipher/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/bob/{bob_spec.cr → spec/bob_spec.cr} +1 -1
- data/tracks/crystal/exercises/bob/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/bracket-push/{bracket_push_spec.cr → spec/bracket_push_spec.cr} +1 -1
- data/tracks/crystal/exercises/bracket-push/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/gigasecond/{gigasecond_spec.cr → spec/gigasecond_spec.cr} +1 -1
- data/tracks/crystal/exercises/gigasecond/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/hamming/{hamming_spec.cr → spec/hamming_spec.cr} +1 -1
- data/tracks/crystal/exercises/hamming/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/hello-world/HINTS.md +32 -0
- data/tracks/crystal/exercises/hello-world/{hello_world_spec.cr → spec/hello_world_spec.cr} +1 -1
- data/tracks/crystal/exercises/hello-world/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/largest-series-product/{largest_series_product_spec.cr → spec/largest_series_product_spec.cr} +1 -1
- data/tracks/crystal/exercises/largest-series-product/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/leap/{leap_spec.cr → spec/leap_spec.cr} +1 -1
- data/tracks/crystal/exercises/leap/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/pangram/{pangram_spec.cr → spec/pangram_spec.cr} +1 -1
- data/tracks/crystal/exercises/pangram/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/raindrops/{raindrops_spec.cr → spec/raindrops_spec.cr} +1 -1
- data/tracks/crystal/exercises/raindrops/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/react/{react_spec.cr → spec/react_spec.cr} +1 -1
- data/tracks/crystal/exercises/react/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/rna-transcription/{rna_transcription_spec.cr → spec/rna_transcription_spec.cr} +1 -1
- data/tracks/crystal/exercises/rna-transcription/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/roman-numerals/{roman_numerals_spec.cr → spec/roman_numerals_spec.cr} +1 -1
- data/tracks/crystal/exercises/roman-numerals/{example.cr → src/example.cr} +0 -0
- data/tracks/crystal/exercises/sieve/{sieve_spec.cr → spec/sieve_spec.cr} +1 -1
- data/tracks/crystal/exercises/sieve/{example.cr → src/example.cr} +0 -0
- data/tracks/haskell/.travis.yml +4 -2
- data/tracks/haskell/config.json +6 -6
- data/tracks/haskell/exercises/alphametics/package.yaml +0 -1
- data/tracks/haskell/exercises/atbash-cipher/package.yaml +0 -1
- data/tracks/haskell/exercises/bank-account/package.yaml +0 -1
- data/tracks/haskell/exercises/binary-search-tree/HINTS.md +3 -2
- data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +2 -0
- data/tracks/haskell/exercises/change/test/Tests.hs +2 -1
- data/tracks/haskell/exercises/connect/package.yaml +0 -1
- data/tracks/haskell/exercises/crypto-square/package.yaml +0 -1
- data/tracks/haskell/exercises/custom-set/HINTS.md +3 -2
- data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +3 -2
- data/tracks/haskell/exercises/food-chain/package.yaml +0 -1
- data/tracks/haskell/exercises/forth/HINTS.md +3 -2
- data/tracks/haskell/exercises/forth/src/Forth.hs +2 -0
- data/tracks/haskell/exercises/go-counting/package.yaml +0 -1
- data/tracks/haskell/exercises/grade-school/package.yaml +0 -1
- data/tracks/haskell/exercises/grains/src/Grains.hs +3 -1
- data/tracks/haskell/exercises/kindergarten-garden/package.yaml +0 -1
- data/tracks/haskell/exercises/largest-series-product/package.yaml +0 -1
- data/tracks/haskell/exercises/lens-person/package.yaml +0 -1
- data/tracks/haskell/exercises/linked-list/package.yaml +0 -1
- data/tracks/haskell/exercises/ocr-numbers/package.yaml +0 -2
- data/tracks/haskell/exercises/parallel-letter-frequency/package.yaml +0 -1
- data/tracks/haskell/exercises/rna-transcription/package.yaml +0 -1
- data/tracks/haskell/exercises/robot-name/package.yaml +0 -1
- data/tracks/haskell/exercises/saddle-points/package.yaml +0 -1
- data/tracks/haskell/exercises/say/package.yaml +0 -1
- data/tracks/haskell/exercises/scrabble-score/package.yaml +0 -1
- data/tracks/haskell/exercises/series/HINTS.md +23 -0
- data/tracks/haskell/exercises/series/examples/success-byteseqs/package.yaml +19 -0
- data/tracks/haskell/exercises/series/examples/success-byteseqs/src/Series.hs +26 -0
- data/tracks/haskell/exercises/series/src/Series.hs +2 -1
- data/tracks/haskell/exercises/series/test/Tests.hs +16 -11
- data/tracks/haskell/exercises/sgf-parsing/package.yaml +0 -1
- data/tracks/haskell/exercises/sieve/package.yaml +0 -1
- data/tracks/haskell/exercises/simple-cipher/package.yaml +0 -1
- data/tracks/haskell/exercises/triangle/package.yaml +0 -1
- data/tracks/haskell/exercises/word-count/examples/success-newtype/src/WordCount.hs +7 -4
- data/tracks/haskell/exercises/word-count/examples/success-simple/src/WordCount.hs +6 -2
- data/tracks/haskell/exercises/word-count/test/Tests.hs +30 -1
- data/tracks/haskell/exercises/wordy/package.yaml +0 -2
- data/tracks/java/docs/INSTALLATION.md +2 -0
- data/tracks/java/exercises/_template/build.gradle +1 -1
- data/tracks/java/exercises/accumulate/build.gradle +1 -1
- data/tracks/java/exercises/acronym/build.gradle +1 -1
- data/tracks/java/exercises/allergies/build.gradle +1 -1
- data/tracks/java/exercises/anagram/build.gradle +1 -1
- data/tracks/java/exercises/atbash-cipher/build.gradle +1 -1
- data/tracks/java/exercises/beer-song/build.gradle +1 -1
- data/tracks/java/exercises/binary/build.gradle +1 -1
- data/tracks/java/exercises/bob/build.gradle +1 -1
- data/tracks/java/exercises/crypto-square/build.gradle +1 -1
- data/tracks/java/exercises/etl/build.gradle +1 -1
- data/tracks/java/exercises/gigasecond/build.gradle +1 -1
- data/tracks/java/exercises/grade-school/build.gradle +1 -1
- data/tracks/java/exercises/hamming/build.gradle +1 -1
- data/tracks/java/exercises/hello-world/build.gradle +1 -1
- data/tracks/java/exercises/hexadecimal/build.gradle +1 -1
- data/tracks/java/exercises/linked-list/build.gradle +1 -1
- data/tracks/java/exercises/luhn/build.gradle +1 -1
- data/tracks/java/exercises/meetup/build.gradle +1 -1
- data/tracks/java/exercises/nth-prime/build.gradle +1 -1
- data/tracks/java/exercises/nucleotide-count/build.gradle +1 -1
- data/tracks/java/exercises/octal/build.gradle +1 -1
- data/tracks/java/exercises/pangram/build.gradle +1 -1
- data/tracks/java/exercises/pascals-triangle/build.gradle +1 -1
- data/tracks/java/exercises/phone-number/build.gradle +1 -1
- data/tracks/java/exercises/pig-latin/build.gradle +1 -1
- data/tracks/java/exercises/raindrops/build.gradle +1 -1
- data/tracks/java/exercises/rna-transcription/build.gradle +1 -1
- data/tracks/java/exercises/robot-name/build.gradle +1 -1
- data/tracks/java/exercises/roman-numerals/build.gradle +1 -1
- data/tracks/java/exercises/scrabble-score/build.gradle +1 -1
- data/tracks/java/exercises/sieve/build.gradle +1 -1
- data/tracks/java/exercises/simple-cipher/build.gradle +1 -1
- data/tracks/java/exercises/simple-linked-list/build.gradle +1 -1
- data/tracks/java/exercises/space-age/build.gradle +1 -1
- data/tracks/java/exercises/strain/build.gradle +1 -1
- data/tracks/java/exercises/triangle/build.gradle +1 -1
- data/tracks/java/exercises/trinary/build.gradle +1 -1
- data/tracks/java/exercises/word-count/build.gradle +1 -1
- data/tracks/ocaml/.travis-ci.sh +1 -1
- data/tracks/ocaml/.travis.yml +1 -1
- data/tracks/ocaml/README.md +1 -1
- data/tracks/ocaml/exercises/hamming/hamming.mli +1 -3
- data/tracks/ruby/exercises/leap/.version +1 -1
- data/tracks/ruby/exercises/leap/example.tt +3 -3
- data/tracks/ruby/exercises/leap/leap_test.rb +3 -4
- data/tracks/ruby/lib/leap_cases.rb +2 -2
- data/tracks/rust/exercises/bowling/tests/bowling.rs +29 -0
- data/tracks/swift/.gitignore +1 -0
- data/tracks/swift/.swift-version +1 -0
- data/tracks/swift/exercises/bowling/BowlingExample.swift +2 -2
- data/tracks/swift/exercises/bowling/BowlingTest.swift +84 -94
- data/tracks/swift/exercises/palindrome-products/PalindromeProductsExample.swift +19 -16
- data/tracks/tcl/README.md +3 -0
- data/tracks/tcl/config.json +2 -1
- data/tracks/tcl/img/icon.png +0 -0
- metadata +46 -33
- data/tracks/crystal/exercises/hello-world/GETTING_STARTED.md +0 -10
Binary file
|
data/tracks/crystal/Makefile
CHANGED
@@ -1,28 +1,24 @@
|
|
1
|
-
# assignments
|
2
1
|
ASSIGNMENT ?= ""
|
3
|
-
IGNOREDIRS := "^(\.git|docs)$$"
|
2
|
+
IGNOREDIRS := "^(\.git|.crystal|docs|bin|img|script)$$"
|
4
3
|
EXERCISESDIR ?= "exercises"
|
5
4
|
ASSIGNMENTS = $(shell find exercises -maxdepth 1 -mindepth 1 -type d | cut -d'/' -f2 | sort | grep -Ev $(IGNOREDIRS))
|
6
5
|
|
7
|
-
# output directories
|
8
|
-
TMPDIR ?= "/tmp"
|
9
|
-
OUTDIR := $(shell mktemp -d "$(TMPDIR)/$(ASSIGNMENT).XXXXXXXXXX")
|
10
|
-
|
11
|
-
# language specific config (tweakable per language)
|
12
6
|
FILEEXT := "cr"
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
7
|
+
SPECDIR = "spec"
|
8
|
+
ASSIGNMENTNAME := "$(subst -,_,$(ASSIGNMENT))"
|
9
|
+
EXERCISESPECDIR := $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECDIR)
|
10
|
+
SPECFILE := "$(ASSIGNMENTNAME)_spec.$(FILEEXT)"
|
11
|
+
TMPSPECFILE := "$(ASSIGNMENTNAME)_spec.$(FILEEXT).tmp"
|
17
12
|
|
18
13
|
test-assignment:
|
19
14
|
@echo "running formatting check for: $(ASSIGNMENT)"
|
20
15
|
@crystal tool format --check $(EXERCISESDIR)/$(ASSIGNMENT)
|
16
|
+
@echo "moving files around"
|
17
|
+
@sed 's/pending/it/g' $(EXERCISESPECDIR)/$(SPECFILE) > $(EXERCISESPECDIR)/$(TMPSPECFILE)
|
18
|
+
@rm $(EXERCISESPECDIR)/$(SPECFILE)
|
19
|
+
@mv $(EXERCISESPECDIR)/$(TMPSPECFILE) $(EXERCISESPECDIR)/$(SPECFILE)
|
21
20
|
@echo "running tests for: $(ASSIGNMENT)"
|
22
|
-
@
|
23
|
-
@cp $(EXERCISESDIR)/$(ASSIGNMENT)/$(EXAMPLE) $(OUTDIR)/$(TESTFILE)
|
24
|
-
@sed 's/pending/it/g' $(EXERCISESDIR)/$(ASSIGNMENT)/$(SPECFILE) > $(OUTDIR)/$(SPECFILE)
|
25
|
-
@cd $(OUTDIR) && crystal spec $(SPECFILE)
|
21
|
+
@cd $(EXERCISESDIR)/$(ASSIGNMENT) && crystal spec
|
26
22
|
@printf "\n"
|
27
23
|
|
28
24
|
test:
|
data/tracks/crystal/SETUP.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
## Learning Crystal
|
2
2
|
|
3
|
-
* [Crystal Official Docs](https://crystal-lang.org/docs/): This is the go-
|
4
|
-
|
5
|
-
* Crystal Playground - While Crystal doesn't have a REPL (like Ruby, Python or Node), it does have a way to somewhat easily experiment with code. Just run `crystal play` and you should have a place to play around with Crystal in your browser at localhost:8080.
|
3
|
+
* [Crystal Official Docs](https://crystal-lang.org/docs/): This is the go-to learning resource for Crystal at the moment. And they are pretty exhaustive, right from the basic literals and variables to some advanced stuff like macros. They also have a neat [doc on coding conventions](https://crystal-lang.org/docs/conventions/index.html).
|
6
4
|
|
7
5
|
* [Crystal for Rubyists](http://www.crystalforrubyists.com/): A practical intro to Crystal language.
|
6
|
+
|
7
|
+
* Crystal Playground - While Crystal doesn't have a built-in REPL (like Ruby, Python or Node), it does have a way to somewhat easily experiment with code. Just run `crystal play` and you should have a place to play around with Crystal in your browser at localhost:8080.
|
8
|
+
|
9
|
+
* Crystal REPL Add-on - A GitHub user has created a REPL of sorts for Crystal. It's called [ICR](https://github.com/greyblake/crystal-icr) (a nod to Ruby's IRB). As most things in Crystal, it's still in a nascent phase and might be prone to bugs.
|
@@ -1,12 +1,25 @@
|
|
1
1
|
## Running Tests
|
2
2
|
|
3
|
-
|
3
|
+
When you are in the directory for an exercise, you should see two subdirectories:
|
4
|
+
|
5
|
+
* `src` contains your solution to the exercise
|
6
|
+
* `spec` contains the tests to run for the exercise
|
7
|
+
|
8
|
+
If you're in the right directory (i.e. the one containing `src` and `spec`), you can run the tests for that exercise by running `crystal spec`:
|
4
9
|
|
5
10
|
```bash
|
6
|
-
$
|
11
|
+
$ pwd
|
12
|
+
/Users/johndoe/Code/exercism/crystal/hello-world
|
13
|
+
|
14
|
+
$ ls
|
15
|
+
GETTING_STARTED.md README.md spec src
|
16
|
+
|
17
|
+
$ crystal spec
|
7
18
|
```
|
8
19
|
|
9
|
-
|
20
|
+
This will run all of the test files in the `spec` directory.
|
21
|
+
|
22
|
+
In each test file, all but the first test have been skipped.
|
10
23
|
|
11
24
|
Once you get a test passing, you can unskip the next one by changing `pending` to `it`.
|
12
25
|
|
@@ -25,3 +38,11 @@ Or you can selectively format files with:
|
|
25
38
|
```bash
|
26
39
|
$ crystal tool format ./<path>/<to>/<file>
|
27
40
|
```
|
41
|
+
|
42
|
+
## Submitting Your Solution
|
43
|
+
|
44
|
+
Be sure to submit the source file in the `src` directory when submitting your solution:
|
45
|
+
|
46
|
+
```bash
|
47
|
+
$ exercism submit src/<exercise>.cr
|
48
|
+
```
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,32 @@
|
|
1
|
+
## Project Structure
|
2
|
+
|
3
|
+
* `src` contains your solution to the exercise
|
4
|
+
* `spec` contains the tests to run for the exercise
|
5
|
+
|
6
|
+
## Running Tests
|
7
|
+
|
8
|
+
If you're in the right directory (i.e. the one containing `src` and `spec`), you can run the tests for that exercise by running `crystal spec`:
|
9
|
+
|
10
|
+
```bash
|
11
|
+
$ pwd
|
12
|
+
/Users/johndoe/Code/exercism/crystal/hello-world
|
13
|
+
|
14
|
+
$ ls
|
15
|
+
GETTING_STARTED.md README.md spec src
|
16
|
+
|
17
|
+
$ crystal spec
|
18
|
+
```
|
19
|
+
|
20
|
+
This will run all of the test files in the `spec` directory.
|
21
|
+
|
22
|
+
In each test file, all but the first test have been skipped.
|
23
|
+
|
24
|
+
Once you get a test passing, you can unskip the next one by changing `pending` to `it`.
|
25
|
+
|
26
|
+
## Submitting Your Solution
|
27
|
+
|
28
|
+
Be sure to submit the source file in the `src` directory when submitting your solution:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
$ exercism submit src/hello_world.cr
|
32
|
+
```
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/tracks/haskell/.travis.yml
CHANGED
@@ -58,8 +58,10 @@ script:
|
|
58
58
|
else
|
59
59
|
for example in examples/*/ ; do
|
60
60
|
examplename=$(basename "$example")
|
61
|
-
|
62
|
-
|
61
|
+
exercisename=$(basename "$exercise")
|
62
|
+
examplecache="${HOME}/.foldercache/${exercisename}/${examplename}/.stack-work"
|
63
|
+
mkdir -p "$examplecache"
|
64
|
+
ln -f -s "$examplecache"
|
63
65
|
|
64
66
|
echo "testing ${example}"
|
65
67
|
rm -f src/*.hs
|
data/tracks/haskell/config.json
CHANGED
@@ -148,12 +148,6 @@
|
|
148
148
|
"topics": [
|
149
149
|
]
|
150
150
|
},
|
151
|
-
{
|
152
|
-
"slug": "word-count",
|
153
|
-
"difficulty": 4,
|
154
|
-
"topics": [
|
155
|
-
]
|
156
|
-
},
|
157
151
|
{
|
158
152
|
"slug": "meetup",
|
159
153
|
"difficulty": 4,
|
@@ -256,6 +250,12 @@
|
|
256
250
|
"topics": [
|
257
251
|
]
|
258
252
|
},
|
253
|
+
{
|
254
|
+
"slug": "word-count",
|
255
|
+
"difficulty": 5,
|
256
|
+
"topics": [
|
257
|
+
]
|
258
|
+
},
|
259
259
|
{
|
260
260
|
"slug": "binary-search-tree",
|
261
261
|
"difficulty": 5,
|
@@ -12,5 +12,6 @@ with `Eq` and `Show` instances, and implement the functions:
|
|
12
12
|
- `singleton`
|
13
13
|
- `toList`
|
14
14
|
|
15
|
-
You will find
|
16
|
-
to define the functions
|
15
|
+
You will find a dummy data declaration and type signatures already in place,
|
16
|
+
but it is up to you to define the functions and create a meaningful data type,
|
17
|
+
newtype or type synonym.
|
@@ -1,6 +1,7 @@
|
|
1
1
|
{-# LANGUAGE RecordWildCards #-}
|
2
2
|
|
3
3
|
import Data.Foldable (for_)
|
4
|
+
import Data.List (sort)
|
4
5
|
import Test.Hspec (Spec, describe, it, shouldBe)
|
5
6
|
import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith)
|
6
7
|
|
@@ -17,7 +18,7 @@ specs = describe "Change" $
|
|
17
18
|
test Case{..} = it description assertion
|
18
19
|
where
|
19
20
|
assertion = expression `shouldBe` expected
|
20
|
-
expression = findFewestCoins target coins
|
21
|
+
expression = sort <$> findFewestCoins target coins
|
21
22
|
|
22
23
|
-- Test cases adapted from `exercism/x-common` on 2016-09-17.
|
23
24
|
|
@@ -17,8 +17,9 @@ with `Eq` and `Show` instances, and implement the following functions:
|
|
17
17
|
- `toList`
|
18
18
|
- `union`
|
19
19
|
|
20
|
-
You will find
|
21
|
-
to define the functions
|
20
|
+
You will find a dummy data declaration and type signatures already in place,
|
21
|
+
but it is up to you to define the functions and create a meaningful data type,
|
22
|
+
newtype or type synonym.
|
22
23
|
|
23
24
|
If you're interested in writing an efficient implementation but don't quite
|
24
25
|
know where to start, the best primer I know of is Chris Okasaki's
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module CustomSet
|
2
|
-
(
|
3
|
-
, delete
|
2
|
+
( delete
|
4
3
|
, difference
|
5
4
|
, empty
|
6
5
|
, fromList
|
@@ -17,6 +16,8 @@ module CustomSet
|
|
17
16
|
|
18
17
|
import Prelude hiding (null)
|
19
18
|
|
19
|
+
data CustomSet a = Dummy deriving (Eq, Show)
|
20
|
+
|
20
21
|
delete :: a -> CustomSet a -> CustomSet a
|
21
22
|
delete = undefined
|
22
23
|
|
@@ -8,5 +8,6 @@ and implement the following functions:
|
|
8
8
|
- `toList` returns the current stack as a list, with the element on top
|
9
9
|
of the stack being the rightmost (last) element.
|
10
10
|
|
11
|
-
You will find
|
12
|
-
to define the functions
|
11
|
+
You will find a dummy data declaration and type signatures already in place,
|
12
|
+
but it is up to you to define the functions and create a meaningful data type,
|
13
|
+
newtype or type synonym.
|