trackler 2.2.1.10 → 2.2.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +3 -0
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/CONTRIBUTING.md +1 -1
- data/problem-specifications/TOPICS.txt +1 -0
- data/problem-specifications/exercises/accumulate/description.md +0 -3
- data/problem-specifications/exercises/hamming/canonical-data.json +3 -3
- data/problem-specifications/exercises/house/canonical-data.json +322 -0
- data/problem-specifications/exercises/palindrome-products/description.md +2 -2
- data/problem-specifications/exercises/simple-cipher/description.md +1 -1
- data/tracks/bash/config.json +0 -11
- data/tracks/cpp/docs/ABOUT.md +12 -37
- data/tracks/csharp/config.json +37 -0
- data/tracks/csharp/config/maintainers.json +10 -0
- data/tracks/csharp/docs/ABOUT.md +1 -1
- data/tracks/csharp/docs/RESOURCES.md +2 -2
- data/tracks/csharp/exercises/Exercises.All.sln +50 -8
- data/tracks/csharp/exercises/Exercises.Default.sln +50 -8
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.cs +9 -0
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.csproj +18 -0
- data/tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs +43 -0
- data/tracks/csharp/exercises/collatz-conjecture/Example.cs +30 -0
- data/tracks/csharp/exercises/collatz-conjecture/README.md +38 -0
- data/tracks/csharp/exercises/diamond/Diamond.cs +1 -1
- data/tracks/csharp/exercises/diamond/Diamond.csproj +3 -1
- data/tracks/csharp/exercises/diamond/DiamondTest.cs +39 -21
- data/tracks/csharp/exercises/diamond/Example.cs +2 -2
- data/tracks/csharp/exercises/diamond/HINTS.md +3 -1
- data/tracks/csharp/exercises/spiral-matrix/Example.cs +40 -0
- data/tracks/csharp/exercises/spiral-matrix/README.md +36 -0
- data/tracks/csharp/exercises/spiral-matrix/SpiralMatrix.cs +9 -0
- data/tracks/csharp/exercises/spiral-matrix/SpiralMatrix.csproj +18 -0
- data/tracks/csharp/exercises/spiral-matrix/SpiralMatrixTest.cs +78 -0
- data/tracks/csharp/exercises/two-fer/Example.cs +16 -0
- data/tracks/csharp/exercises/two-fer/README.md +25 -0
- data/tracks/csharp/exercises/two-fer/TwoFer.cs +9 -0
- data/tracks/csharp/exercises/two-fer/TwoFer.csproj +18 -0
- data/tracks/csharp/exercises/two-fer/TwoFerTest.cs +24 -0
- data/tracks/dart/README.md +1 -1
- data/tracks/dart/docs/EXERCISE_README_INSERT.md +9 -0
- data/tracks/dart/docs/INSTALLATION.md +13 -0
- data/tracks/dart/docs/LEARNING.md +6 -0
- data/tracks/dart/docs/RESOURCES.md +7 -0
- data/tracks/dart/docs/TESTS.md +133 -0
- data/tracks/delphi/docs/ABOUT.md +18 -5
- data/tracks/delphi/docs/Getting_Started_Guide.md +930 -0
- data/tracks/delphi/exercises/hamming/uHammingExample.pas +1 -1
- data/tracks/delphi/exercises/hamming/uHammingTests.pas +15 -15
- data/tracks/ecmascript/.travis.yml +2 -1
- data/tracks/ecmascript/Makefile +19 -8
- data/tracks/ecmascript/config.json +16 -0
- data/tracks/ecmascript/exercises/accumulate/package.json +5 -5
- data/tracks/ecmascript/exercises/acronym/package.json +5 -5
- data/tracks/ecmascript/exercises/all-your-base/package.json +5 -5
- data/tracks/ecmascript/exercises/allergies/package.json +5 -5
- data/tracks/ecmascript/exercises/alphametics/package.json +5 -5
- data/tracks/ecmascript/exercises/anagram/package.json +5 -5
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +5 -5
- data/tracks/ecmascript/exercises/beer-song/package.json +5 -5
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +5 -5
- data/tracks/ecmascript/exercises/binary-search/package.json +5 -5
- data/tracks/ecmascript/exercises/binary/package.json +5 -5
- data/tracks/ecmascript/exercises/bob/package.json +5 -5
- data/tracks/ecmascript/exercises/bracket-push/package.json +5 -5
- data/tracks/ecmascript/exercises/circular-buffer/package.json +5 -5
- data/tracks/ecmascript/exercises/clock/package.json +5 -5
- data/tracks/ecmascript/exercises/connect/package.json +5 -5
- data/tracks/ecmascript/exercises/crypto-square/package.json +5 -5
- data/tracks/ecmascript/exercises/custom-set/package.json +5 -5
- data/tracks/ecmascript/exercises/diamond/package.json +5 -5
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +5 -5
- data/tracks/ecmascript/exercises/diffie-hellman/package.json +5 -5
- data/tracks/ecmascript/exercises/etl/package.json +5 -5
- data/tracks/ecmascript/exercises/flatten-array/package.json +5 -5
- data/tracks/ecmascript/exercises/food-chain/package.json +5 -5
- data/tracks/ecmascript/exercises/gigasecond/package.json +5 -5
- data/tracks/ecmascript/exercises/grade-school/package.json +5 -5
- data/tracks/ecmascript/exercises/grains/package.json +5 -5
- data/tracks/ecmascript/exercises/hamming/package.json +5 -5
- data/tracks/ecmascript/exercises/hello-world/package.json +5 -5
- data/tracks/ecmascript/exercises/hexadecimal/package.json +5 -5
- data/tracks/ecmascript/exercises/isogram/package.json +5 -5
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +5 -5
- data/tracks/ecmascript/exercises/largest-series-product/package.json +5 -5
- data/tracks/ecmascript/exercises/leap/package.json +5 -5
- data/tracks/ecmascript/exercises/linked-list/package.json +5 -5
- data/tracks/ecmascript/exercises/list-ops/package.json +5 -5
- data/tracks/ecmascript/exercises/luhn/package.json +5 -5
- data/tracks/ecmascript/exercises/matrix/package.json +5 -5
- data/tracks/ecmascript/exercises/meetup/package.json +5 -5
- data/tracks/ecmascript/exercises/minesweeper/package.json +5 -5
- data/tracks/ecmascript/exercises/nth-prime/package.json +5 -5
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +5 -5
- data/tracks/ecmascript/exercises/octal/package.json +5 -5
- data/tracks/ecmascript/exercises/palindrome-products/package.json +5 -5
- data/tracks/ecmascript/exercises/pangram/package.json +5 -5
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +5 -5
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +5 -5
- data/tracks/ecmascript/exercises/phone-number/package.json +5 -5
- data/tracks/ecmascript/exercises/pig-latin/package.json +5 -5
- data/tracks/ecmascript/exercises/prime-factors/package.json +5 -5
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +5 -5
- data/tracks/ecmascript/exercises/queen-attack/package.json +5 -5
- data/tracks/ecmascript/exercises/raindrops/package.json +5 -5
- data/tracks/ecmascript/exercises/rna-transcription/package.json +5 -5
- data/tracks/ecmascript/exercises/robot-name/package.json +5 -5
- data/tracks/ecmascript/exercises/robot-simulator/package.json +5 -5
- data/tracks/ecmascript/exercises/roman-numerals/package.json +5 -5
- data/tracks/ecmascript/exercises/run-length-encoding/README.md +59 -0
- data/tracks/ecmascript/exercises/run-length-encoding/example.js +13 -0
- data/tracks/ecmascript/exercises/run-length-encoding/package.json +69 -0
- data/tracks/ecmascript/exercises/run-length-encoding/run-length-encoding.spec.js +59 -0
- data/tracks/ecmascript/exercises/saddle-points/package.json +5 -5
- data/tracks/ecmascript/exercises/say/package.json +5 -5
- data/tracks/ecmascript/exercises/scrabble-score/package.json +5 -5
- data/tracks/ecmascript/exercises/secret-handshake/package.json +5 -5
- data/tracks/ecmascript/exercises/series/package.json +5 -5
- data/tracks/ecmascript/exercises/sieve/package.json +5 -5
- data/tracks/ecmascript/exercises/simple-cipher/package.json +5 -5
- data/tracks/ecmascript/exercises/space-age/package.json +5 -5
- data/tracks/ecmascript/exercises/strain/package.json +5 -5
- data/tracks/ecmascript/exercises/sublist/package.json +5 -5
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +5 -5
- data/tracks/ecmascript/exercises/triangle/package.json +5 -5
- data/tracks/ecmascript/exercises/trinary/package.json +5 -5
- data/tracks/ecmascript/exercises/twelve-days/package.json +6 -5
- data/tracks/ecmascript/exercises/two-bucket/package.json +5 -5
- data/tracks/ecmascript/exercises/word-count/package.json +5 -5
- data/tracks/ecmascript/exercises/wordy/package.json +5 -5
- data/tracks/ecmascript/package.json +5 -5
- data/tracks/ecmascript/yarn.lock +403 -152
- data/tracks/elixir/docs/ABOUT.md +7 -20
- data/tracks/erlang/docs/ABOUT.md +4 -6
- data/tracks/fsharp/config.json +2 -1
- data/tracks/fsharp/docs/ABOUT.md +6 -2
- data/tracks/gnu-apl/.gitignore +4 -0
- data/tracks/gnu-apl/.travis.yml +5 -0
- data/tracks/gnu-apl/LICENSE +21 -0
- data/tracks/gnu-apl/README.md +67 -0
- data/tracks/gnu-apl/bin/fetch-configlet +32 -0
- data/tracks/gnu-apl/config.json +15 -0
- data/tracks/{scala/exercises/binary-search/src/main/scala/BinarySearch.scala → gnu-apl/config/exercise-readme-insert.md} +0 -0
- data/tracks/gnu-apl/config/exercise-readme.go.tmpl +16 -0
- data/tracks/gnu-apl/config/maintainers.json +6 -0
- data/tracks/gnu-apl/docs/ABOUT.md +0 -0
- data/tracks/gnu-apl/docs/INSTALLATION.md +0 -0
- data/tracks/gnu-apl/docs/LEARNING.md +0 -0
- data/tracks/gnu-apl/docs/RESOURCES.md +0 -0
- data/tracks/gnu-apl/docs/TESTS.md +0 -0
- data/tracks/gnu-apl/img/.keep +0 -0
- data/tracks/go/docs/ABOUT.md +4 -2
- data/tracks/go/exercises/pangram/example.go +1 -1
- data/tracks/go/exercises/pangram/pangram.go +1 -1
- data/tracks/go/exercises/pangram/pangram_test.go +1 -3
- data/tracks/groovy/README.md +2 -0
- data/tracks/groovy/config.json +25 -20
- data/tracks/groovy/docs/ABOUT.md +10 -3
- data/tracks/groovy/exercises/difference-of-squares/DifferenceOfSquares.groovy +19 -0
- data/tracks/groovy/exercises/difference-of-squares/{SquaresSpec.groovy → DifferenceOfSquaresSpec.groovy} +3 -3
- data/tracks/groovy/exercises/difference-of-squares/Example.groovy +1 -1
- data/tracks/groovy/exercises/hamming/Hamming.groovy +7 -0
- data/tracks/groovy/exercises/leap/Example.groovy +2 -2
- data/tracks/groovy/exercises/leap/Leap.groovy +11 -0
- data/tracks/groovy/exercises/leap/LeapSpec.groovy +4 -4
- data/tracks/groovy/exercises/nth-prime/Example.groovy +1 -1
- data/tracks/groovy/exercises/nth-prime/NthPrime.groovy +7 -0
- data/tracks/groovy/exercises/nth-prime/{PrimeSpec.groovy → NthPrimeSpec.groovy} +6 -6
- data/tracks/groovy/exercises/phone-number/PhoneNumber.groovy +17 -0
- data/tracks/groovy/exercises/raindrops/Raindrops.groovy +7 -0
- data/tracks/groovy/exercises/rna-transcription/Example.groovy +1 -1
- data/tracks/groovy/exercises/rna-transcription/RnaTranscription.groovy +7 -0
- data/tracks/groovy/exercises/rna-transcription/{ComplementSpec.groovy → RnaTranscriptionSpec.groovy} +2 -2
- data/tracks/groovy/exercises/robot-name/Example.groovy +2 -2
- data/tracks/groovy/exercises/robot-name/RobotName.groovy +9 -0
- data/tracks/groovy/exercises/robot-name/{RobotSpec.groovy → RobotNameSpec.groovy} +6 -6
- data/tracks/groovy/exercises/roman-numerals/Example.groovy +2 -2
- data/tracks/groovy/exercises/roman-numerals/RomanNumerals.groovy +7 -0
- data/tracks/groovy/exercises/roman-numerals/{RomanSpec.groovy → RomanNumeralsSpec.groovy} +2 -2
- data/tracks/groovy/exercises/word-count/Example.groovy +2 -2
- data/tracks/groovy/exercises/word-count/{Phrase.groovy → WordCount.groovy} +2 -2
- data/tracks/groovy/exercises/word-count/WordCountSpec.groovy +47 -0
- data/tracks/java/config.json +84 -74
- data/tracks/java/docs/ABOUT.md +11 -5
- data/tracks/java/exercises/house/README.md +124 -0
- data/tracks/java/exercises/house/build.gradle +18 -0
- data/tracks/java/exercises/house/src/example/java/House.java +55 -0
- data/tracks/java/exercises/house/src/main/java/.keep +0 -0
- data/tracks/java/exercises/house/src/test/java/HouseTest.java +341 -0
- data/tracks/java/exercises/minesweeper/src/example/java/MinesweeperBoard.java +3 -3
- data/tracks/java/exercises/series/src/test/java/SeriesTest.java +6 -5
- data/tracks/java/exercises/settings.gradle +1 -0
- data/tracks/java/exercises/two-fer/src/test/java/TwoferTest.java +9 -0
- data/tracks/javascript/exercises/circular-buffer/circular-buffer.spec.js +8 -0
- data/tracks/javascript/exercises/simple-cipher/README.md +1 -1
- data/tracks/kotlin/docs/ABOUT.md +7 -10
- data/tracks/lisp/.travis.yml +26 -11
- data/tracks/purescript/docs/ABOUT.md +16 -0
- data/tracks/r/config.json +1 -1
- data/tracks/r/config/maintainers.json +9 -9
- data/tracks/r/docs/ABOUT.md +9 -11
- data/tracks/r/docs/snippet.txt +10 -0
- data/tracks/ruby/docs/ABOUT.md +5 -5
- data/tracks/ruby/exercises/collatz-conjecture/.meta/generator/collatz_conjecture_case.rb +1 -2
- data/tracks/ruby/exercises/space-age/.meta/generator/space_age_case.rb +1 -2
- data/tracks/ruby/exercises/sum-of-multiples/.meta/generator/sum_of_multiples_case.rb +1 -1
- data/tracks/ruby/lib/generator/exercise_case.rb +15 -0
- data/tracks/scala/exercises/alphametics/src/test/scala/AlphameticsTest.scala +42 -28
- data/tracks/scala/exercises/binary-search/example.scala +1 -1
- data/tracks/scala/exercises/binary-search/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/binary-search/src/test/scala/BinarySearchTest.scala +13 -22
- data/tracks/scala/exercises/bowling/src/main/scala/.keep +0 -0
- data/tracks/scala/exercises/bowling/src/test/scala/BowlingSuite.scala +30 -17
- data/tracks/scala/exercises/change/src/test/scala/ChangeTest.scala +14 -4
- data/tracks/scala/exercises/custom-set/src/test/scala/CustomSetTest.scala +6 -4
- data/tracks/scala/exercises/food-chain/example.scala +4 -2
- data/tracks/scala/exercises/food-chain/src/test/scala/FoodChainTest.scala +170 -59
- data/tracks/scala/exercises/luhn/example.scala +9 -21
- data/tracks/scala/exercises/luhn/src/test/scala/LuhnTest.scala +46 -10
- data/tracks/scala/testgen/src/main/scala/AlphametricsTestGenerator.scala +42 -0
- data/tracks/scala/testgen/src/main/scala/BinarySearchTestGenerator.scala +32 -42
- data/tracks/scala/testgen/src/main/scala/BowlingTestGenerator.scala +22 -7
- data/tracks/scala/testgen/src/main/scala/ChangeTestGenerator.scala +37 -0
- data/tracks/scala/testgen/src/main/scala/CustomSetTestGenerator.scala +25 -20
- data/tracks/scala/testgen/src/main/scala/FoodChainTestGenerator.scala +13 -2
- data/tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala +15 -0
- data/tracks/scala/testgen/src/main/scala/TestBuilder.scala +10 -0
- data/tracks/sml/.travis.yml +9 -2
- data/tracks/sml/Makefile +42 -0
- data/tracks/sml/docs/EXERCISE_README_INSERT.md +21 -5
- data/tracks/sml/docs/RESOURCES.md +1 -1
- data/tracks/sml/docs/TESTS.md +2 -2
- metadata +67 -17
- data/tracks/bash/exercises/word-count/README.md +0 -24
- data/tracks/bash/exercises/word-count/example.awk +0 -12
- data/tracks/bash/exercises/word-count/example.sh +0 -21
- data/tracks/dart/.github/PULL_REQUEST_TEMPLATE.md +0 -23
- data/tracks/ecmascript/.babelrc +0 -3
- data/tracks/groovy/exercises/roman-numerals/Roman.groovy +0 -33
- data/tracks/groovy/exercises/word-count/PhraseSpec.groovy +0 -47
- data/tracks/scala/exercises/bowling/src/main/scala/Bowling.scala +0 -11
@@ -1,8 +1,19 @@
|
|
1
1
|
import testgen._
|
2
|
-
import TestSuiteBuilder._
|
2
|
+
import TestSuiteBuilder.{toString, _}
|
3
3
|
import java.io.File
|
4
4
|
|
5
5
|
object FoodChainTestGenerator {
|
6
|
+
def sutArgs(parseResult: CanonicalDataParser.ParseResult, argNames: String*): String = {
|
7
|
+
val firstParam = parseResult.get("start verse") match {
|
8
|
+
case Some(s) => s.toString
|
9
|
+
case _ => throw new IllegalArgumentException("Missing start verse")
|
10
|
+
}
|
11
|
+
val secondParam = parseResult.get("end verse")
|
12
|
+
|
13
|
+
firstParam + secondParam.map(s => ", " + s.toString).getOrElse("")
|
14
|
+
}
|
15
|
+
|
16
|
+
|
6
17
|
def main(args: Array[String]): Unit = {
|
7
18
|
val file = new File("src/main/resources/food-chain.json")
|
8
19
|
|
@@ -23,7 +34,7 @@ object FoodChainTestGenerator {
|
|
23
34
|
}
|
24
35
|
|
25
36
|
val code = TestSuiteBuilder.build(file,
|
26
|
-
fromLabeledTest("start verse"))
|
37
|
+
fromLabeledTest("start verse", "end verse"))
|
27
38
|
println(s"-------------")
|
28
39
|
println(code)
|
29
40
|
println(s"-------------")
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import java.io.File
|
2
|
+
|
3
|
+
import testgen.TestSuiteBuilder._
|
4
|
+
import testgen._
|
5
|
+
|
6
|
+
object LuhnGenerator {
|
7
|
+
def main(args: Array[String]): Unit = {
|
8
|
+
val file = new File("src/main/resources/luhn.json")
|
9
|
+
|
10
|
+
val code = TestSuiteBuilder.build(file, fromLabeledTest("input"))
|
11
|
+
println(s"-------------")
|
12
|
+
println(code)
|
13
|
+
println(s"-------------")
|
14
|
+
}
|
15
|
+
}
|
@@ -19,6 +19,9 @@ class TestBuilder(testName: String) {
|
|
19
19
|
private var imports: Seq[String] = Seq()
|
20
20
|
def addImport(imprt: String): Unit = imports = imports :+ imprt
|
21
21
|
|
22
|
+
private var version: Option[String] = None
|
23
|
+
def setVersion(v: String): Unit = this.version = Some(v)
|
24
|
+
|
22
25
|
private var testCases: Seq[(Seq[TestCaseGen], Option[String])] = Seq()
|
23
26
|
def addTestCases(testCases: Seq[TestCaseGen], description: Option[String] = None): Unit =
|
24
27
|
this.testCases = this.testCases :+ (testCases, description)
|
@@ -33,11 +36,18 @@ class TestBuilder(testName: String) {
|
|
33
36
|
|
34
37
|
def build: String =
|
35
38
|
s"""$printImports
|
39
|
+
$printVersion
|
36
40
|
class $testName extends FunSuite with Matchers {
|
37
41
|
$printTestCases
|
38
42
|
}
|
39
43
|
"""
|
40
44
|
|
45
|
+
private lazy val printVersion: String =
|
46
|
+
version match {
|
47
|
+
case Some(v) => s"""/** @version $v */"""
|
48
|
+
case None => ""
|
49
|
+
}
|
50
|
+
|
41
51
|
private lazy val printImports: String =
|
42
52
|
"import org.scalatest.{FunSuite, Matchers}\n" +
|
43
53
|
(imports map (imp => s"import $imp\n") mkString)
|
data/tracks/sml/.travis.yml
CHANGED
@@ -1,5 +1,12 @@
|
|
1
|
-
language:
|
2
|
-
|
1
|
+
language: generic
|
2
|
+
sudo: false
|
3
|
+
install:
|
4
|
+
- curl -LO https://github.com/polyml/polyml/archive/v5.7.tar.gz
|
5
|
+
- tar xf v5.7.tar.gz
|
6
|
+
- cd polyml-5.7 && ./configure --prefix=$HOME/.local && make && make install && cd -
|
7
|
+
- export PATH=$PATH:$HOME/.local/bin
|
8
|
+
- which poly
|
3
9
|
script:
|
4
10
|
- bin/fetch-configlet
|
5
11
|
- bin/configlet lint .
|
12
|
+
- make travis
|
data/tracks/sml/Makefile
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
dirs := $(wildcard exercises/*)
|
2
|
+
all-tests := $(addprefix test-, $(notdir $(dirs)))
|
3
|
+
|
4
|
+
COMMIT_RANGE := HEAD
|
5
|
+
ifdef TRAVIS_PULL_REQUEST
|
6
|
+
ifneq ($(TRAVIS_PULL_REQUEST), false)
|
7
|
+
COMMIT_RANGE := master..HEAD
|
8
|
+
endif
|
9
|
+
endif
|
10
|
+
|
11
|
+
test: $(all-tests)
|
12
|
+
|
13
|
+
debug:
|
14
|
+
@echo ---------------
|
15
|
+
@echo HEAD: $(shell git rev-list -1 HEAD)
|
16
|
+
@echo master: $(shell git rev-list -1 master 2> /dev/null)
|
17
|
+
@echo COMMIT_RANGE: $(COMMIT_RANGE)
|
18
|
+
@echo TRAVIS_COMMIT_RANGE: $(TRAVIS_COMMIT_RANGE)
|
19
|
+
@echo TRAVIS_PULL_REQUEST: $(TRAVIS_PULL_REQUEST)
|
20
|
+
@echo TRAVIS_COMMIT: $(TRAVIS_COMMIT)
|
21
|
+
@echo Modified/Added:
|
22
|
+
@git diff-tree --name-status -r --no-commit-id --diff-filter=AM -M $(COMMIT_RANGE)
|
23
|
+
@echo Renamed:
|
24
|
+
@git diff-tree --name-status -r --no-commit-id --diff-filter=R -M $(COMMIT_RANGE)
|
25
|
+
@echo ---------------
|
26
|
+
|
27
|
+
travis:
|
28
|
+
@$(MAKE) -s debug
|
29
|
+
$(eval tests := $(shell \
|
30
|
+
git diff-tree --name-only -r --diff-filter=AM $(COMMIT_RANGE) | \
|
31
|
+
perl -n -e '/exercises\/([a-z-_]+)\/.+\.sml/ && print "test-$$1\n"' | uniq))
|
32
|
+
$(if $(tests), @echo Tests: $(tests), @echo 'Nothing to test.')
|
33
|
+
$(if $(tests), @$(MAKE) -s $(tests))
|
34
|
+
|
35
|
+
test-%:
|
36
|
+
$(eval exercise := $(patsubst test-%, %, $@))
|
37
|
+
@echo "# $(exercise)"
|
38
|
+
@echo
|
39
|
+
@cd ./exercises/$(exercise) && cat test.sml | sed 's/$(exercise).sml/example.sml/' | poly -q
|
40
|
+
@echo
|
41
|
+
|
42
|
+
.PHONY: test
|
@@ -1,12 +1,28 @@
|
|
1
|
-
##
|
1
|
+
## Loading your exercise implementation in PolyML
|
2
2
|
|
3
|
-
|
3
|
+
```
|
4
|
+
$ poly --use {exercise}.sml
|
5
|
+
```
|
6
|
+
|
7
|
+
Or:
|
4
8
|
|
5
9
|
```
|
6
|
-
$ poly
|
10
|
+
$ poly
|
11
|
+
> use "{exercise}.sml";
|
7
12
|
```
|
8
13
|
|
9
|
-
|
14
|
+
**Note:** You have to replace {exercise}.
|
15
|
+
|
16
|
+
## Running the tests
|
17
|
+
|
10
18
|
```
|
11
|
-
$ poly --use
|
19
|
+
$ poly -q --use test.sml
|
12
20
|
```
|
21
|
+
|
22
|
+
## Feedback, Issues, Pull Requests
|
23
|
+
|
24
|
+
The [exercism/sml](https://github.com/exercism/sml) repository on
|
25
|
+
GitHub is the home for all of the Standard ML exercises.
|
26
|
+
|
27
|
+
If you have feedback about an exercise, or want to help implementing a new
|
28
|
+
one, head over there and create an issue. We'll do our best to help you!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Books
|
2
2
|
- [The Definition of Standard ML](https://github.com/SMLFamily/The-Definition-of-Standard-ML-Revised)
|
3
3
|
- [Purely Functional Data Structures](https://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504)
|
4
|
-
- [Chris Okasaki's
|
4
|
+
- [Chris Okasaki's thesis](https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf)
|
5
5
|
- [Modern Compiler Implementation in ML](https://www.amazon.com/Modern-Compiler-Implementation-Andrew-Appel/dp/0521607647)
|
6
6
|
- [Notes on Programming SML/NJ](http://www.cs.cornell.edu/riccardo/prog-smlnj/notes-011001.pdf)
|
7
7
|
|
data/tracks/sml/docs/TESTS.md
CHANGED
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.11
|
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-08-
|
11
|
+
date: 2017-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -362,6 +362,7 @@ files:
|
|
362
362
|
- problem-specifications/exercises/hexadecimal/.deprecated
|
363
363
|
- problem-specifications/exercises/hexadecimal/description.md
|
364
364
|
- problem-specifications/exercises/hexadecimal/metadata.yml
|
365
|
+
- problem-specifications/exercises/house/canonical-data.json
|
365
366
|
- problem-specifications/exercises/house/description.md
|
366
367
|
- problem-specifications/exercises/house/metadata.yml
|
367
368
|
- problem-specifications/exercises/isogram/canonical-data.json
|
@@ -619,9 +620,6 @@ files:
|
|
619
620
|
- tracks/bash/exercises/two-fer/README.md
|
620
621
|
- tracks/bash/exercises/two-fer/example.sh
|
621
622
|
- tracks/bash/exercises/two-fer/two_fer_test.sh
|
622
|
-
- tracks/bash/exercises/word-count/README.md
|
623
|
-
- tracks/bash/exercises/word-count/example.awk
|
624
|
-
- tracks/bash/exercises/word-count/example.sh
|
625
623
|
- tracks/bash/img/icon.png
|
626
624
|
- tracks/c/.git
|
627
625
|
- tracks/c/.github/stale.yml
|
@@ -1859,6 +1857,11 @@ files:
|
|
1859
1857
|
- tracks/csharp/exercises/clock/Example.cs
|
1860
1858
|
- tracks/csharp/exercises/clock/HINTS.md
|
1861
1859
|
- tracks/csharp/exercises/clock/README.md
|
1860
|
+
- tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.cs
|
1861
|
+
- tracks/csharp/exercises/collatz-conjecture/CollatzConjecture.csproj
|
1862
|
+
- tracks/csharp/exercises/collatz-conjecture/CollatzConjectureTest.cs
|
1863
|
+
- tracks/csharp/exercises/collatz-conjecture/Example.cs
|
1864
|
+
- tracks/csharp/exercises/collatz-conjecture/README.md
|
1862
1865
|
- tracks/csharp/exercises/connect/Connect.cs
|
1863
1866
|
- tracks/csharp/exercises/connect/Connect.csproj
|
1864
1867
|
- tracks/csharp/exercises/connect/ConnectTest.cs
|
@@ -2239,6 +2242,11 @@ files:
|
|
2239
2242
|
- tracks/csharp/exercises/space-age/SpaceAge.cs
|
2240
2243
|
- tracks/csharp/exercises/space-age/SpaceAge.csproj
|
2241
2244
|
- tracks/csharp/exercises/space-age/SpaceAgeTest.cs
|
2245
|
+
- tracks/csharp/exercises/spiral-matrix/Example.cs
|
2246
|
+
- tracks/csharp/exercises/spiral-matrix/README.md
|
2247
|
+
- tracks/csharp/exercises/spiral-matrix/SpiralMatrix.cs
|
2248
|
+
- tracks/csharp/exercises/spiral-matrix/SpiralMatrix.csproj
|
2249
|
+
- tracks/csharp/exercises/spiral-matrix/SpiralMatrixTest.cs
|
2242
2250
|
- tracks/csharp/exercises/strain/Example.cs
|
2243
2251
|
- tracks/csharp/exercises/strain/README.md
|
2244
2252
|
- tracks/csharp/exercises/strain/Strain.cs
|
@@ -2287,6 +2295,11 @@ files:
|
|
2287
2295
|
- tracks/csharp/exercises/two-bucket/TwoBucket.cs
|
2288
2296
|
- tracks/csharp/exercises/two-bucket/TwoBucket.csproj
|
2289
2297
|
- tracks/csharp/exercises/two-bucket/TwoBucketTest.cs
|
2298
|
+
- tracks/csharp/exercises/two-fer/Example.cs
|
2299
|
+
- tracks/csharp/exercises/two-fer/README.md
|
2300
|
+
- tracks/csharp/exercises/two-fer/TwoFer.cs
|
2301
|
+
- tracks/csharp/exercises/two-fer/TwoFer.csproj
|
2302
|
+
- tracks/csharp/exercises/two-fer/TwoFerTest.cs
|
2290
2303
|
- tracks/csharp/exercises/variable-length-quantity/Example.cs
|
2291
2304
|
- tracks/csharp/exercises/variable-length-quantity/HINTS.md
|
2292
2305
|
- tracks/csharp/exercises/variable-length-quantity/README.md
|
@@ -2468,7 +2481,6 @@ files:
|
|
2468
2481
|
- tracks/d/exercises/triangle/source/triangle.d
|
2469
2482
|
- tracks/d/img/icon.png
|
2470
2483
|
- tracks/dart/.git
|
2471
|
-
- tracks/dart/.github/PULL_REQUEST_TEMPLATE.md
|
2472
2484
|
- tracks/dart/.gitignore
|
2473
2485
|
- tracks/dart/.travis.yml
|
2474
2486
|
- tracks/dart/LICENSE
|
@@ -2545,6 +2557,7 @@ files:
|
|
2545
2557
|
- tracks/delphi/config/maintainers.json
|
2546
2558
|
- tracks/delphi/docs/ABOUT.md
|
2547
2559
|
- tracks/delphi/docs/EXERCISE_README_INSERT.md
|
2560
|
+
- tracks/delphi/docs/Getting_Started_Guide.md
|
2548
2561
|
- tracks/delphi/docs/INSTALLATION.md
|
2549
2562
|
- tracks/delphi/docs/LEARNING.md
|
2550
2563
|
- tracks/delphi/docs/RESOURCES.md
|
@@ -2676,7 +2689,6 @@ files:
|
|
2676
2689
|
- tracks/delphi/exercises/wordy/uWordyTests.pas
|
2677
2690
|
- tracks/delphi/img/.keep
|
2678
2691
|
- tracks/delphi/img/icon.png
|
2679
|
-
- tracks/ecmascript/.babelrc
|
2680
2692
|
- tracks/ecmascript/.editorconfig
|
2681
2693
|
- tracks/ecmascript/.git
|
2682
2694
|
- tracks/ecmascript/.github/stale.yml
|
@@ -2928,6 +2940,10 @@ files:
|
|
2928
2940
|
- tracks/ecmascript/exercises/roman-numerals/example.js
|
2929
2941
|
- tracks/ecmascript/exercises/roman-numerals/package.json
|
2930
2942
|
- tracks/ecmascript/exercises/roman-numerals/roman-numerals.spec.js
|
2943
|
+
- tracks/ecmascript/exercises/run-length-encoding/README.md
|
2944
|
+
- tracks/ecmascript/exercises/run-length-encoding/example.js
|
2945
|
+
- tracks/ecmascript/exercises/run-length-encoding/package.json
|
2946
|
+
- tracks/ecmascript/exercises/run-length-encoding/run-length-encoding.spec.js
|
2931
2947
|
- tracks/ecmascript/exercises/saddle-points/README.md
|
2932
2948
|
- tracks/ecmascript/exercises/saddle-points/example.js
|
2933
2949
|
- tracks/ecmascript/exercises/saddle-points/package.json
|
@@ -4448,6 +4464,22 @@ files:
|
|
4448
4464
|
- tracks/fsharp/img/icon.png
|
4449
4465
|
- tracks/fsharp/paket.dependencies
|
4450
4466
|
- tracks/fsharp/paket.lock
|
4467
|
+
- tracks/gnu-apl/.git
|
4468
|
+
- tracks/gnu-apl/.gitignore
|
4469
|
+
- tracks/gnu-apl/.travis.yml
|
4470
|
+
- tracks/gnu-apl/LICENSE
|
4471
|
+
- tracks/gnu-apl/README.md
|
4472
|
+
- tracks/gnu-apl/bin/fetch-configlet
|
4473
|
+
- tracks/gnu-apl/config.json
|
4474
|
+
- tracks/gnu-apl/config/exercise-readme-insert.md
|
4475
|
+
- tracks/gnu-apl/config/exercise-readme.go.tmpl
|
4476
|
+
- tracks/gnu-apl/config/maintainers.json
|
4477
|
+
- tracks/gnu-apl/docs/ABOUT.md
|
4478
|
+
- tracks/gnu-apl/docs/INSTALLATION.md
|
4479
|
+
- tracks/gnu-apl/docs/LEARNING.md
|
4480
|
+
- tracks/gnu-apl/docs/RESOURCES.md
|
4481
|
+
- tracks/gnu-apl/docs/TESTS.md
|
4482
|
+
- tracks/gnu-apl/img/.keep
|
4451
4483
|
- tracks/go/.git
|
4452
4484
|
- tracks/go/.gitignore
|
4453
4485
|
- tracks/go/.travis.yml
|
@@ -4839,9 +4871,10 @@ files:
|
|
4839
4871
|
- tracks/groovy/docs/LEARNING.md
|
4840
4872
|
- tracks/groovy/docs/RESOURCES.md
|
4841
4873
|
- tracks/groovy/docs/TESTS.md
|
4874
|
+
- tracks/groovy/exercises/difference-of-squares/DifferenceOfSquares.groovy
|
4875
|
+
- tracks/groovy/exercises/difference-of-squares/DifferenceOfSquaresSpec.groovy
|
4842
4876
|
- tracks/groovy/exercises/difference-of-squares/Example.groovy
|
4843
4877
|
- tracks/groovy/exercises/difference-of-squares/README.md
|
4844
|
-
- tracks/groovy/exercises/difference-of-squares/SquaresSpec.groovy
|
4845
4878
|
- tracks/groovy/exercises/gigasecond/Example.groovy
|
4846
4879
|
- tracks/groovy/exercises/gigasecond/Gigasecond.groovy
|
4847
4880
|
- tracks/groovy/exercises/gigasecond/GigasecondSpec.groovy
|
@@ -4851,6 +4884,7 @@ files:
|
|
4851
4884
|
- tracks/groovy/exercises/grains/GrainsSpec.groovy
|
4852
4885
|
- tracks/groovy/exercises/grains/README.md
|
4853
4886
|
- tracks/groovy/exercises/hamming/Example.groovy
|
4887
|
+
- tracks/groovy/exercises/hamming/Hamming.groovy
|
4854
4888
|
- tracks/groovy/exercises/hamming/HammingSpec.groovy
|
4855
4889
|
- tracks/groovy/exercises/hamming/README.md
|
4856
4890
|
- tracks/groovy/exercises/hello-world/Example.groovy
|
@@ -4858,31 +4892,37 @@ files:
|
|
4858
4892
|
- tracks/groovy/exercises/hello-world/HelloWorldSpec.groovy
|
4859
4893
|
- tracks/groovy/exercises/hello-world/README.md
|
4860
4894
|
- tracks/groovy/exercises/leap/Example.groovy
|
4895
|
+
- tracks/groovy/exercises/leap/Leap.groovy
|
4861
4896
|
- tracks/groovy/exercises/leap/LeapSpec.groovy
|
4862
4897
|
- tracks/groovy/exercises/leap/README.md
|
4863
4898
|
- tracks/groovy/exercises/nth-prime/Example.groovy
|
4864
|
-
- tracks/groovy/exercises/nth-prime/
|
4899
|
+
- tracks/groovy/exercises/nth-prime/NthPrime.groovy
|
4900
|
+
- tracks/groovy/exercises/nth-prime/NthPrimeSpec.groovy
|
4865
4901
|
- tracks/groovy/exercises/nth-prime/README.md
|
4866
4902
|
- tracks/groovy/exercises/phone-number/Example.groovy
|
4903
|
+
- tracks/groovy/exercises/phone-number/PhoneNumber.groovy
|
4867
4904
|
- tracks/groovy/exercises/phone-number/PhoneNumberSpec.groovy
|
4868
4905
|
- tracks/groovy/exercises/phone-number/README.md
|
4869
4906
|
- tracks/groovy/exercises/raindrops/Example.groovy
|
4870
4907
|
- tracks/groovy/exercises/raindrops/README.md
|
4908
|
+
- tracks/groovy/exercises/raindrops/Raindrops.groovy
|
4871
4909
|
- tracks/groovy/exercises/raindrops/RaindropsSpec.groovy
|
4872
|
-
- tracks/groovy/exercises/rna-transcription/ComplementSpec.groovy
|
4873
4910
|
- tracks/groovy/exercises/rna-transcription/Example.groovy
|
4874
4911
|
- tracks/groovy/exercises/rna-transcription/README.md
|
4912
|
+
- tracks/groovy/exercises/rna-transcription/RnaTranscription.groovy
|
4913
|
+
- tracks/groovy/exercises/rna-transcription/RnaTranscriptionSpec.groovy
|
4875
4914
|
- tracks/groovy/exercises/robot-name/Example.groovy
|
4876
4915
|
- tracks/groovy/exercises/robot-name/README.md
|
4877
|
-
- tracks/groovy/exercises/robot-name/
|
4916
|
+
- tracks/groovy/exercises/robot-name/RobotName.groovy
|
4917
|
+
- tracks/groovy/exercises/robot-name/RobotNameSpec.groovy
|
4878
4918
|
- tracks/groovy/exercises/roman-numerals/Example.groovy
|
4879
4919
|
- tracks/groovy/exercises/roman-numerals/README.md
|
4880
|
-
- tracks/groovy/exercises/roman-numerals/
|
4881
|
-
- tracks/groovy/exercises/roman-numerals/
|
4920
|
+
- tracks/groovy/exercises/roman-numerals/RomanNumerals.groovy
|
4921
|
+
- tracks/groovy/exercises/roman-numerals/RomanNumeralsSpec.groovy
|
4882
4922
|
- tracks/groovy/exercises/word-count/Example.groovy
|
4883
|
-
- tracks/groovy/exercises/word-count/Phrase.groovy
|
4884
|
-
- tracks/groovy/exercises/word-count/PhraseSpec.groovy
|
4885
4923
|
- tracks/groovy/exercises/word-count/README.md
|
4924
|
+
- tracks/groovy/exercises/word-count/WordCount.groovy
|
4925
|
+
- tracks/groovy/exercises/word-count/WordCountSpec.groovy
|
4886
4926
|
- tracks/groovy/img/icon.png
|
4887
4927
|
- tracks/haskell/.git
|
4888
4928
|
- tracks/haskell/.gitignore
|
@@ -5805,6 +5845,11 @@ files:
|
|
5805
5845
|
- tracks/java/exercises/hexadecimal/src/example/java/Hexadecimal.java
|
5806
5846
|
- tracks/java/exercises/hexadecimal/src/main/java/.keep
|
5807
5847
|
- tracks/java/exercises/hexadecimal/src/test/java/HexadecimalTest.java
|
5848
|
+
- tracks/java/exercises/house/README.md
|
5849
|
+
- tracks/java/exercises/house/build.gradle
|
5850
|
+
- tracks/java/exercises/house/src/example/java/House.java
|
5851
|
+
- tracks/java/exercises/house/src/main/java/.keep
|
5852
|
+
- tracks/java/exercises/house/src/test/java/HouseTest.java
|
5808
5853
|
- tracks/java/exercises/isogram/HINTS.md
|
5809
5854
|
- tracks/java/exercises/isogram/README.md
|
5810
5855
|
- tracks/java/exercises/isogram/build.gradle
|
@@ -9425,6 +9470,7 @@ files:
|
|
9425
9470
|
- tracks/r/docs/LEARNING.md
|
9426
9471
|
- tracks/r/docs/RESOURCES.md
|
9427
9472
|
- tracks/r/docs/TESTS.md
|
9473
|
+
- tracks/r/docs/snippet.txt
|
9428
9474
|
- tracks/r/exercises/anagram/README.md
|
9429
9475
|
- tracks/r/exercises/anagram/anagram.R
|
9430
9476
|
- tracks/r/exercises/anagram/example.R
|
@@ -10643,7 +10689,7 @@ files:
|
|
10643
10689
|
- tracks/scala/exercises/binary-search/README.md
|
10644
10690
|
- tracks/scala/exercises/binary-search/build.sbt
|
10645
10691
|
- tracks/scala/exercises/binary-search/example.scala
|
10646
|
-
- tracks/scala/exercises/binary-search/src/main/scala
|
10692
|
+
- tracks/scala/exercises/binary-search/src/main/scala/.keep
|
10647
10693
|
- tracks/scala/exercises/binary-search/src/test/scala/BinarySearchTest.scala
|
10648
10694
|
- tracks/scala/exercises/binary/README.md
|
10649
10695
|
- tracks/scala/exercises/binary/build.sbt
|
@@ -10663,7 +10709,7 @@ files:
|
|
10663
10709
|
- tracks/scala/exercises/bowling/Example.scala
|
10664
10710
|
- tracks/scala/exercises/bowling/README.md
|
10665
10711
|
- tracks/scala/exercises/bowling/build.sbt
|
10666
|
-
- tracks/scala/exercises/bowling/src/main/scala
|
10712
|
+
- tracks/scala/exercises/bowling/src/main/scala/.keep
|
10667
10713
|
- tracks/scala/exercises/bowling/src/test/scala/BowlingSuite.scala
|
10668
10714
|
- tracks/scala/exercises/bracket-push/README.md
|
10669
10715
|
- tracks/scala/exercises/bracket-push/build.sbt
|
@@ -11044,6 +11090,7 @@ files:
|
|
11044
11090
|
- tracks/scala/testgen/project/plugins.sbt
|
11045
11091
|
- tracks/scala/testgen/src/main/scala/AcronymTestGenerator.scala
|
11046
11092
|
- tracks/scala/testgen/src/main/scala/AllYourBaseTestGenerator.scala
|
11093
|
+
- tracks/scala/testgen/src/main/scala/AlphametricsTestGenerator.scala
|
11047
11094
|
- tracks/scala/testgen/src/main/scala/AnagramTestGenerator.scala
|
11048
11095
|
- tracks/scala/testgen/src/main/scala/AtbashCipherTestGenerator.scala
|
11049
11096
|
- tracks/scala/testgen/src/main/scala/BeerSongTestGenerator.scala
|
@@ -11052,6 +11099,7 @@ files:
|
|
11052
11099
|
- tracks/scala/testgen/src/main/scala/BookStoreTestGenerator.scala
|
11053
11100
|
- tracks/scala/testgen/src/main/scala/BowlingTestGenerator.scala
|
11054
11101
|
- tracks/scala/testgen/src/main/scala/BracketPushTestGenerator.scala
|
11102
|
+
- tracks/scala/testgen/src/main/scala/ChangeTestGenerator.scala
|
11055
11103
|
- tracks/scala/testgen/src/main/scala/CryptoSquareTestGenerator.scala
|
11056
11104
|
- tracks/scala/testgen/src/main/scala/CustomSetTestGenerator.scala
|
11057
11105
|
- tracks/scala/testgen/src/main/scala/DifferenceOfSquaresTestGenerator.scala
|
@@ -11062,6 +11110,7 @@ files:
|
|
11062
11110
|
- tracks/scala/testgen/src/main/scala/HelloWorldTestGenerator.scala
|
11063
11111
|
- tracks/scala/testgen/src/main/scala/IsogramTestGenerator.scala
|
11064
11112
|
- tracks/scala/testgen/src/main/scala/LeapTestGenerator.scala
|
11113
|
+
- tracks/scala/testgen/src/main/scala/LuhnTestGenerator.scala
|
11065
11114
|
- tracks/scala/testgen/src/main/scala/NucleotideCountTestGenerator.scala
|
11066
11115
|
- tracks/scala/testgen/src/main/scala/PangramsTestGenerator.scala
|
11067
11116
|
- tracks/scala/testgen/src/main/scala/PascalsTriangleTestGenerator.scala
|
@@ -11163,6 +11212,7 @@ files:
|
|
11163
11212
|
- tracks/sml/.gitignore
|
11164
11213
|
- tracks/sml/.travis.yml
|
11165
11214
|
- tracks/sml/LICENSE
|
11215
|
+
- tracks/sml/Makefile
|
11166
11216
|
- tracks/sml/README.md
|
11167
11217
|
- tracks/sml/SETUP.md
|
11168
11218
|
- tracks/sml/bin/fetch-configlet
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# Word Count
|
2
|
-
|
3
|
-
Given a phrase, count the occurrences of each word in that phrase.
|
4
|
-
|
5
|
-
For example for the input `"olly olly in come free"`
|
6
|
-
|
7
|
-
```plain
|
8
|
-
olly: 2
|
9
|
-
in: 1
|
10
|
-
come: 1
|
11
|
-
free: 1
|
12
|
-
```
|
13
|
-
|
14
|
-
|
15
|
-
Run the tests with:
|
16
|
-
|
17
|
-
bats whatever_test.sh
|
18
|
-
|
19
|
-
## Source
|
20
|
-
|
21
|
-
This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour.
|
22
|
-
|
23
|
-
## Submitting Incomplete Solutions
|
24
|
-
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|