trackler 2.0.6.11 → 2.0.6.12
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 +6 -1
- data/common/exercises/difference-of-squares/metadata.yml +1 -1
- data/common/exercises/luhn/canonical-data.json +2 -2
- data/common/exercises/rectangles/canonical-data.json +25 -0
- data/common/exercises/rectangles/description.md +11 -3
- data/lib/trackler/version.rb +1 -1
- data/tracks/ceylon/config.json +9 -0
- data/tracks/ceylon/exercises/anagram/source/anagram/AnagramTest.ceylon +38 -39
- data/tracks/ceylon/exercises/bracket-push/source/bracketpush/BracketsTest.ceylon +28 -29
- data/tracks/ceylon/exercises/largest-series-product/example/Series.ceylon +13 -0
- data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/Series.ceylon +5 -0
- data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/SeriesTest.ceylon +30 -0
- data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/module.ceylon +3 -0
- data/tracks/csharp/config.json +41 -0
- data/tracks/csharp/exercises/alphametics/AlphameticsTest.cs +122 -0
- data/tracks/csharp/exercises/alphametics/Example.cs +139 -0
- data/tracks/csharp/exercises/dot-dsl/DotDslTest.cs +91 -0
- data/tracks/csharp/exercises/dot-dsl/Example.cs +90 -0
- data/tracks/csharp/exercises/dot-dsl/HINTS.md +2 -0
- data/tracks/csharp/exercises/error-handling/ErrorHandlingTest.cs +65 -0
- data/tracks/csharp/exercises/error-handling/Example.cs +34 -0
- data/tracks/csharp/exercises/exercises.csproj +1 -1
- data/tracks/csharp/exercises/hangman/Example.cs +85 -0
- data/tracks/csharp/exercises/hangman/HangmanTest.cs +140 -0
- data/tracks/csharp/exercises/ledger/Example.cs +106 -0
- data/tracks/csharp/exercises/ledger/Ledger.cs +166 -0
- data/tracks/csharp/exercises/ledger/LedgerTest.cs +168 -0
- data/tracks/elixir/exercises/allergies/allergies_test.exs +2 -2
- data/tracks/elixir/exercises/markdown/example.exs +3 -3
- data/tracks/elixir/exercises/phone-number/example.exs +0 -2
- data/tracks/elixir/exercises/queen-attack/example.exs +1 -1
- data/tracks/elixir/exercises/wordy/example.exs +6 -6
- data/tracks/elixir/exercises/zipper/zipper_test.exs +12 -12
- data/tracks/elixir/mix.exs +1 -1
- data/tracks/fsharp/config.json +8 -8
- data/tracks/fsharp/docs/ABOUT.md +4 -0
- data/tracks/fsharp/exercises/alphametics/AlphameticsTest.fs +33 -13
- data/tracks/fsharp/exercises/alphametics/Example.fs +29 -64
- data/tracks/fsharp/exercises/binary-search-tree/BinarySearchTreeTest.fs +14 -14
- data/tracks/fsharp/exercises/binary-search-tree/Example.fs +17 -14
- data/tracks/fsharp/exercises/triangle/TriangleTest.fs +0 -5
- data/tracks/go/README.md +3 -3
- data/tracks/go/config.json +10 -3
- data/tracks/go/exercises/acronym/acronym.go +5 -0
- data/tracks/go/exercises/bob/example_gen.go +1 -1
- data/tracks/go/exercises/clock/example_gen.go +1 -1
- data/tracks/go/exercises/connect/example_gen.go +1 -1
- data/tracks/go/exercises/custom-set/example_gen.go +1 -1
- data/tracks/go/exercises/gigasecond/example_gen.go +1 -1
- data/tracks/go/exercises/hamming/example_gen.go +1 -1
- data/tracks/go/exercises/largest-series-product/example_gen.go +1 -1
- data/tracks/go/exercises/leap/cases_test.go +5 -7
- data/tracks/go/exercises/leap/example.go +1 -1
- data/tracks/go/exercises/leap/example_gen.go +1 -1
- data/tracks/go/exercises/leap/leap.go +1 -1
- data/tracks/go/exercises/leap/leap_test.go +1 -1
- data/tracks/go/exercises/meetup/example_gen.go +1 -1
- data/tracks/go/exercises/nucleotide-count/nucleotide_count_test.go +0 -5
- data/tracks/go/exercises/pangram/pangram.go +5 -0
- data/tracks/go/exercises/raindrops/example_gen.go +1 -1
- data/tracks/go/exercises/rna-transcription/example_gen.go +1 -1
- data/tracks/go/exercises/roman-numerals/example_gen.go +1 -1
- data/tracks/go/exercises/word-count/example_gen.go +1 -1
- data/tracks/go/gen/gen.go +3 -2
- data/tracks/haskell/exercises/accumulate/src/Accumulate.hs +1 -1
- data/tracks/haskell/exercises/all-your-base/src/Base.hs +1 -1
- data/tracks/haskell/exercises/allergies/src/Allergies.hs +2 -2
- data/tracks/haskell/exercises/alphametics/src/Alphametics.hs +1 -1
- data/tracks/haskell/exercises/anagram/src/Anagram.hs +1 -1
- data/tracks/haskell/exercises/atbash-cipher/src/Atbash.hs +2 -2
- data/tracks/haskell/exercises/bank-account/src/BankAccount.hs +4 -4
- data/tracks/haskell/exercises/binary/src/Binary.hs +1 -1
- data/tracks/haskell/exercises/binary-search-tree/src/BST.hs +8 -8
- data/tracks/haskell/exercises/bob/src/Bob.hs +1 -1
- data/tracks/haskell/exercises/bowling/src/Bowling.hs +1 -1
- data/tracks/haskell/exercises/change/src/Change.hs +1 -1
- data/tracks/haskell/exercises/clock/src/Clock.hs +4 -4
- data/tracks/haskell/exercises/connect/src/Connect.hs +1 -1
- data/tracks/haskell/exercises/crypto-square/src/CryptoSquare.hs +1 -1
- data/tracks/haskell/exercises/custom-set/src/CustomSet.hs +13 -13
- data/tracks/haskell/exercises/difference-of-squares/src/Squares.hs +3 -3
- data/tracks/haskell/exercises/dominoes/src/Dominoes.hs +1 -1
- data/tracks/haskell/exercises/etl/src/ETL.hs +1 -1
- data/tracks/haskell/exercises/forth/src/Forth.hs +3 -3
- data/tracks/haskell/exercises/gigasecond/src/Gigasecond.hs +1 -1
- data/tracks/haskell/exercises/go-counting/src/Counting.hs +2 -2
- data/tracks/haskell/exercises/grade-school/src/School.hs +4 -4
- data/tracks/haskell/exercises/grains/src/Grains.hs +2 -2
- data/tracks/haskell/exercises/hamming/src/Hamming.hs +1 -1
- data/tracks/haskell/exercises/hexadecimal/src/Hexadecimal.hs +1 -1
- data/tracks/haskell/exercises/kindergarten-garden/src/Garden.hs +3 -3
- data/tracks/haskell/exercises/largest-series-product/src/Series.hs +1 -1
- data/tracks/haskell/exercises/leap/src/LeapYear.hs +1 -1
- data/tracks/haskell/exercises/lens-person/src/Person.hs +4 -4
- data/tracks/haskell/exercises/linked-list/src/Deque.hs +5 -5
- data/tracks/haskell/exercises/list-ops/src/ListOps.hs +8 -8
- data/tracks/haskell/exercises/luhn/src/Luhn.hs +5 -5
- data/tracks/haskell/exercises/matrix/src/Matrix.hs +10 -10
- data/tracks/haskell/exercises/meetup/src/Meetup.hs +1 -1
- data/tracks/haskell/exercises/minesweeper/src/Minesweeper.hs +1 -1
- data/tracks/haskell/exercises/nth-prime/src/Prime.hs +1 -1
- data/tracks/haskell/exercises/nucleotide-count/src/DNA.hs +2 -2
- data/tracks/haskell/exercises/ocr-numbers/src/OCR.hs +1 -1
- data/tracks/haskell/exercises/octal/src/Octal.hs +2 -2
- data/tracks/haskell/exercises/palindrome-products/src/Palindromes.hs +2 -2
- data/tracks/haskell/exercises/parallel-letter-frequency/src/Frequency.hs +1 -1
- data/tracks/haskell/exercises/pascals-triangle/src/Triangle.hs +1 -1
- data/tracks/haskell/exercises/phone-number/src/Phone.hs +3 -3
- data/tracks/haskell/exercises/pig-latin/src/PigLatin.hs +1 -1
- data/tracks/haskell/exercises/pov/src/POV.hs +2 -2
- data/tracks/haskell/exercises/prime-factors/src/PrimeFactors.hs +1 -1
- data/tracks/haskell/exercises/pythagorean-triplet/src/Triplet.hs +3 -3
- data/tracks/haskell/exercises/queen-attack/src/Queens.hs +2 -2
- data/tracks/haskell/exercises/raindrops/src/Raindrops.hs +1 -1
- data/tracks/haskell/exercises/rna-transcription/src/DNA.hs +1 -1
- data/tracks/haskell/exercises/robot-name/src/Robot.hs +3 -3
- data/tracks/haskell/exercises/robot-simulator/src/Robot.hs +6 -6
- data/tracks/haskell/exercises/roman-numerals/src/Roman.hs +1 -1
- data/tracks/haskell/exercises/run-length-encoding/src/RunLength.hs +2 -2
- data/tracks/haskell/exercises/saddle-points/src/Matrix.hs +1 -1
- data/tracks/haskell/exercises/say/src/Say.hs +1 -1
- data/tracks/haskell/exercises/scrabble-score/src/Scrabble.hs +2 -2
- data/tracks/haskell/exercises/secret-handshake/src/SecretHandshake.hs +1 -1
- data/tracks/haskell/exercises/series/src/Series.hs +1 -1
- data/tracks/haskell/exercises/sgf-parsing/src/Sgf.hs +1 -1
- data/tracks/haskell/exercises/sieve/src/Sieve.hs +1 -1
- data/tracks/haskell/exercises/simple-cipher/src/Cipher.hs +3 -3
- data/tracks/haskell/exercises/simple-linked-list/src/LinkedList.hs +8 -8
- data/tracks/haskell/exercises/space-age/src/SpaceAge.hs +1 -1
- data/tracks/haskell/exercises/strain/src/Strain.hs +2 -2
- data/tracks/haskell/exercises/sublist/src/Sublist.hs +1 -1
- data/tracks/haskell/exercises/sum-of-multiples/src/SumOfMultiples.hs +1 -1
- data/tracks/haskell/exercises/triangle/src/Triangle.hs +1 -1
- data/tracks/haskell/exercises/trinary/src/Trinary.hs +2 -2
- data/tracks/haskell/exercises/word-count/src/WordCount.hs +1 -1
- data/tracks/haskell/exercises/wordy/src/WordProblem.hs +1 -1
- data/tracks/haskell/exercises/zebra-puzzle/src/ZebraPuzzle.hs +1 -1
- data/tracks/haskell/exercises/zipper/src/Zipper.hs +9 -9
- data/tracks/java/docs/MAINTAINING.md +48 -0
- data/tracks/java/exercises/queen-attack/src/test/java/QueenAttackCalculatorTest.java +51 -51
- data/tracks/kotlin/exercises/etl/src/example/kotlin/ETL.kt +1 -1
- data/tracks/kotlin/exercises/etl/src/test/kotlin/ETLTest.kt +19 -19
- data/tracks/kotlin/exercises/pangram/src/test/kotlin/PangramTest.kt +5 -0
- data/tracks/lisp/docs/ABOUT.md +9 -0
- data/tracks/lua/exercises/transpose/example.lua +1 -1
- data/tracks/lua/exercises/transpose/transpose_spec.lua +16 -0
- data/tracks/pascal/config.json +36 -36
- data/tracks/pascal/exercises/bob/uBobTests.pas +0 -1
- data/tracks/pascal/exercises/hamming/uHammingTests.pas +0 -1
- data/tracks/pascal/exercises/leap/uLeapTests.pas +0 -1
- data/tracks/pascal/exercises/saddle-points/uSaddlePointsExample.pas +11 -0
- data/tracks/pascal/exercises/saddle-points/uSaddlePointsTests.pas +9 -1
- data/tracks/perl6/exercises/atbash-cipher/cipher.t +1 -1
- data/tracks/php/config.json +7 -0
- data/tracks/php/exercises/robot-simulator/example.php +148 -0
- data/tracks/php/exercises/robot-simulator/robot-simulator_test.php +168 -0
- data/tracks/pony/config.json +16 -7
- data/tracks/pony/exercises/roman-numerals/example.pony +35 -0
- data/tracks/pony/exercises/roman-numerals/test.pony +45 -0
- data/tracks/python/requirements-travis.txt +1 -1
- data/tracks/ruby/.rubocop.yml +1 -1
- data/tracks/ruby/bin/enable-executable +1 -1
- data/tracks/ruby/bin/executable-tests-check +1 -1
- data/tracks/ruby/exercises/acronym/example.tt +2 -3
- data/tracks/ruby/exercises/all-your-base/example.tt +2 -2
- data/tracks/ruby/exercises/alphametics/example.tt +2 -2
- data/tracks/ruby/exercises/anagram/example.tt +2 -3
- data/tracks/ruby/exercises/binary/example.tt +2 -3
- data/tracks/ruby/exercises/bowling/example.tt +2 -3
- data/tracks/ruby/exercises/bracket-push/example.tt +2 -3
- data/tracks/ruby/exercises/clock/example.tt +2 -3
- data/tracks/ruby/exercises/connect/example.rb +1 -1
- data/tracks/ruby/exercises/connect/example.tt +1 -1
- data/tracks/ruby/exercises/custom-set/example.tt +2 -3
- data/tracks/ruby/exercises/diamond/example.rb +1 -1
- data/tracks/ruby/exercises/difference-of-squares/example.tt +2 -3
- data/tracks/ruby/exercises/dominoes/example.tt +2 -2
- data/tracks/ruby/exercises/gigasecond/example.tt +2 -3
- data/tracks/ruby/exercises/grains/example.tt +2 -2
- data/tracks/ruby/exercises/hamming/example.tt +2 -3
- data/tracks/ruby/exercises/hello-world/example.tt +1 -2
- data/tracks/ruby/exercises/isogram/example.tt +2 -2
- data/tracks/ruby/exercises/largest-series-product/example.tt +2 -4
- data/tracks/ruby/exercises/leap/example.tt +2 -3
- data/tracks/ruby/exercises/nth-prime/example.tt +2 -4
- data/tracks/ruby/exercises/pangram/example.tt +2 -2
- data/tracks/ruby/exercises/queen-attack/example.tt +2 -3
- data/tracks/ruby/exercises/raindrops/example.tt +2 -3
- data/tracks/ruby/exercises/rna-transcription/example.tt +2 -3
- data/tracks/ruby/exercises/roman-numerals/example.tt +2 -3
- data/tracks/ruby/exercises/run-length-encoding/example.tt +2 -3
- data/tracks/ruby/exercises/sieve/example.tt +2 -4
- data/tracks/ruby/exercises/simple-linked-list/simple_linked_list_test.rb +6 -6
- data/tracks/ruby/exercises/tournament/example.tt +2 -3
- data/tracks/ruby/exercises/transpose/example.tt +2 -3
- data/tracks/ruby/exercises/triangle/example.tt +2 -3
- data/tracks/ruby/exercises/two-bucket/example.tt +2 -3
- data/tracks/ruby/exercises/word-count/example.tt +2 -3
- data/tracks/ruby/exercises/wordy/example.tt +2 -2
- data/tracks/ruby/lib/acronym_cases.rb +2 -0
- data/tracks/ruby/lib/all_your_base_cases.rb +3 -1
- data/tracks/ruby/lib/alphametics_cases.rb +6 -4
- data/tracks/ruby/lib/anagram_cases.rb +2 -0
- data/tracks/ruby/lib/binary_cases.rb +2 -0
- data/tracks/ruby/lib/bowling_cases.rb +2 -0
- data/tracks/ruby/lib/bracket_push_cases.rb +2 -0
- data/tracks/ruby/lib/clock_cases.rb +2 -0
- data/tracks/ruby/lib/connect_cases.rb +2 -0
- data/tracks/ruby/lib/custom_set_cases.rb +2 -0
- data/tracks/ruby/lib/difference_of_squares_cases.rb +2 -0
- data/tracks/ruby/lib/dominoes_cases.rb +2 -0
- data/tracks/ruby/lib/exercise_cases.rb +2 -0
- data/tracks/ruby/lib/generator/files/track_files.rb +3 -3
- data/tracks/ruby/lib/generator/files.rb +1 -1
- data/tracks/ruby/lib/generator/template_values.rb +5 -14
- data/tracks/ruby/lib/gigasecond_cases.rb +2 -0
- data/tracks/ruby/lib/grains_cases.rb +3 -1
- data/tracks/ruby/lib/hamming_cases.rb +2 -0
- data/tracks/ruby/lib/hello_world_cases.rb +2 -0
- data/tracks/ruby/lib/isogram_cases.rb +3 -1
- data/tracks/ruby/lib/largest_series_product_cases.rb +2 -0
- data/tracks/ruby/lib/leap_cases.rb +2 -0
- data/tracks/ruby/lib/nth_prime_cases.rb +2 -0
- data/tracks/ruby/lib/pangram_cases.rb +3 -1
- data/tracks/ruby/lib/queen_attack_cases.rb +2 -0
- data/tracks/ruby/lib/raindrops_cases.rb +2 -0
- data/tracks/ruby/lib/rna_transcription_cases.rb +2 -0
- data/tracks/ruby/lib/roman_numerals_cases.rb +2 -0
- data/tracks/ruby/lib/run_length_encoding_cases.rb +2 -0
- data/tracks/ruby/lib/sieve_cases.rb +2 -0
- data/tracks/ruby/lib/tournament_cases.rb +2 -0
- data/tracks/ruby/lib/transpose_cases.rb +2 -0
- data/tracks/ruby/lib/triangle_cases.rb +2 -0
- data/tracks/ruby/lib/two_bucket_cases.rb +2 -0
- data/tracks/ruby/lib/word_count_cases.rb +2 -0
- data/tracks/ruby/lib/wordy_cases.rb +2 -0
- data/tracks/ruby/test/fixtures/xruby/exercises/alpha/example.tt +2 -2
- data/tracks/ruby/test/fixtures/xruby/lib/alpha_cases.rb +1 -1
- data/tracks/ruby/test/generator/command_line_test.rb +1 -1
- data/tracks/ruby/test/generator/template_values_test.rb +7 -7
- data/tracks/rust/.travis.yml +4 -0
- data/tracks/rust/_test/check-exercises.sh +11 -2
- data/tracks/rust/config.json +9 -0
- data/tracks/rust/exercises/luhn/.gitignore +7 -0
- data/tracks/rust/exercises/luhn/Cargo.toml +3 -0
- data/tracks/rust/exercises/luhn/example.rs +13 -0
- data/tracks/rust/exercises/luhn/tests/luhn.rs +38 -0
- data/tracks/rust/exercises/parallel-letter-frequency/HINTS.md +32 -0
- data/tracks/rust/exercises/parallel-letter-frequency/benches/benchmark.rs +99 -0
- data/tracks/scala/config.json +57 -1
- data/tracks/scala/exercises/allergies/build.sbt +2 -2
- data/tracks/scala/exercises/atbash-cipher/build.sbt +2 -2
- data/tracks/scala/exercises/bank-account/build.sbt +3 -2
- data/tracks/scala/exercises/binary-search-tree/build.sbt +2 -2
- data/tracks/scala/exercises/clock/build.sbt +2 -2
- data/tracks/scala/exercises/crypto-square/build.sbt +2 -2
- data/tracks/scala/exercises/custom-set/build.sbt +3 -2
- data/tracks/scala/exercises/food-chain/build.sbt +3 -2
- data/tracks/scala/exercises/house/build.sbt +2 -2
- data/tracks/scala/exercises/kindergarten-garden/build.sbt +3 -2
- data/tracks/scala/exercises/largest-series-product/build.sbt +2 -2
- data/tracks/scala/exercises/linked-list/build.sbt +3 -2
- data/tracks/scala/exercises/matrix/build.sbt +2 -2
- data/tracks/scala/exercises/minesweeper/build.sbt +2 -2
- data/tracks/scala/exercises/nth-prime/build.sbt +2 -2
- data/tracks/scala/exercises/ocr-numbers/build.sbt +2 -2
- data/tracks/scala/exercises/palindrome-products/build.sbt +2 -2
- data/tracks/scala/exercises/prime-factors/build.sbt +3 -2
- data/tracks/scala/exercises/queen-attack/build.sbt +2 -2
- data/tracks/scala/exercises/raindrops/build.sbt +2 -2
- data/tracks/scala/exercises/robot-simulator/build.sbt +2 -2
- data/tracks/scala/exercises/triangle/build.sbt +2 -2
- data/tracks/scala/exercises/trinary/build.sbt +2 -2
- data/tracks/scala/exercises/wordy/build.sbt +3 -3
- metadata +33 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa8f1408ac09a98a6c3586666f197c85efa0b7cb
|
4
|
+
data.tar.gz: 71653c98fd6b510de72b238db40cdee9ac0ed1d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cceac782125c988061568125f85e50bccdb0da21583c36279a48e0b885b265bc3b47a542dbaf5379844b025a4d54c81e462b4e03cb051e7012471242b0aa0fc
|
7
|
+
data.tar.gz: 50ca76ed02285f8230a10d7f5c3b099ce78c18d10aa1bc93726cae239eae45e5a90cb1fbe11707bcf86c4066a9a51726fb235da36ca3469683a25c78ce91d350
|
data/common/CONTRIBUTING.md
CHANGED
@@ -337,7 +337,12 @@ The exercise should consist of, at minimum:
|
|
337
337
|
* A test suite
|
338
338
|
* A reference solution that passes the test (see [#reference-solution](#reference-solution))
|
339
339
|
|
340
|
-
|
340
|
+
You will need to add the exercise to `"exercises"` section of the `config.json` file in the track.
|
341
|
+
The order in which the exercises are listed there is the order in which they are fetched by default by `exercism fetch`.
|
342
|
+
Typically, exercises are ordered by difficulty, unless there is a particular reason to do otherwise.
|
343
|
+
|
344
|
+
Each language track might have additional guidance on how to order their
|
345
|
+
exercises or additional requirements on new exercise files; check the README in
|
341
346
|
the repository for the track.
|
342
347
|
|
343
348
|
### Providing Feedback on the Site for an Exercise You Implemented
|
@@ -1,4 +1,4 @@
|
|
1
1
|
---
|
2
|
-
blurb: "Find the difference between the sum of the squares and the square of the
|
2
|
+
blurb: "Find the difference between the sum of the squares and the square of the sum of the first N natural numbers."
|
3
3
|
source: "Problem 6 at Project Euler"
|
4
4
|
source_url: "http://projecteuler.net/problem=6"
|
@@ -26,8 +26,8 @@
|
|
26
26
|
"expected": false
|
27
27
|
},
|
28
28
|
{
|
29
|
-
"description": "strings
|
30
|
-
"input": "
|
29
|
+
"description": "valid strings with a non-digit added become invalid",
|
30
|
+
"input": "046a 454 286",
|
31
31
|
"expected": false
|
32
32
|
}
|
33
33
|
]
|
@@ -50,6 +50,31 @@
|
|
50
50
|
],
|
51
51
|
"expected": 5
|
52
52
|
},
|
53
|
+
{
|
54
|
+
"description": "rectangle of height 1 is counted",
|
55
|
+
"input": [
|
56
|
+
"+--+",
|
57
|
+
"+--+"
|
58
|
+
],
|
59
|
+
"expected": 1
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"description": "rectangle of width 1 is counted",
|
63
|
+
"input": [
|
64
|
+
"++",
|
65
|
+
"||",
|
66
|
+
"++"
|
67
|
+
],
|
68
|
+
"expected": 1
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"description": "1x1 square is counted",
|
72
|
+
"input": [
|
73
|
+
"++",
|
74
|
+
"++"
|
75
|
+
],
|
76
|
+
"expected": 1
|
77
|
+
},
|
53
78
|
{
|
54
79
|
"description": "only complete rectangles are counted",
|
55
80
|
"input": [
|
@@ -2,13 +2,13 @@ Create a program to count the rectangles in an ASCII diagram like the one below.
|
|
2
2
|
|
3
3
|
```
|
4
4
|
+--+
|
5
|
-
|
6
|
-
|
5
|
+
++ |
|
6
|
+
+-++--+
|
7
7
|
| | |
|
8
8
|
+--+--+
|
9
9
|
```
|
10
10
|
|
11
|
-
The above diagram contains
|
11
|
+
The above diagram contains 6 rectangles:
|
12
12
|
|
13
13
|
```
|
14
14
|
|
@@ -50,5 +50,13 @@ The above diagram contains 5 rectangles:
|
|
50
50
|
+--+
|
51
51
|
```
|
52
52
|
|
53
|
+
```
|
54
|
+
|
55
|
+
++
|
56
|
+
++
|
57
|
+
|
58
|
+
|
59
|
+
```
|
60
|
+
|
53
61
|
You may assume that the input is always a proper rectangle (i.e. the length of
|
54
62
|
every line equals the length of the first line).
|
data/lib/trackler/version.rb
CHANGED
data/tracks/ceylon/config.json
CHANGED
@@ -1,44 +1,43 @@
|
|
1
1
|
import ceylon.test { ... }
|
2
2
|
|
3
|
-
{[String, {String*}, {String*}]*} cases =>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
};
|
3
|
+
{[String, {String*}, {String*}]*} cases => {
|
4
|
+
// no matches
|
5
|
+
["diaper", {"hello", "world", "zombies", "pants"}, {}],
|
6
|
+
// detects simple anagram
|
7
|
+
["ant", {"tan", "stand", "at"}, {"tan"}],
|
8
|
+
// does not detect false positives
|
9
|
+
["galea", {"eagle"}, {}],
|
10
|
+
// detects multiple anagrams
|
11
|
+
["master", {"stream", "pigeon", "maters"}, {"stream", "maters"}],
|
12
|
+
// does not detect anagram subsets
|
13
|
+
["good", {"dog", "goody"}, {}],
|
14
|
+
// detects anagram
|
15
|
+
["listen", {"enlists", "google", "inlets", "banana"}, {"inlets"}],
|
16
|
+
// detects multiple anagrams
|
17
|
+
[
|
18
|
+
"allergy",
|
19
|
+
{"gallery", "ballerina", "regally", "clergy", "largely", "leading"},
|
20
|
+
{"gallery", "regally", "largely"}
|
21
|
+
],
|
22
|
+
// does not detect identical words
|
23
|
+
["corn", {"corn", "dark", "Corn", "rank", "CORN", "cron", "park"}, {"cron"}],
|
24
|
+
// does not detect non-anagrams with identical checksum
|
25
|
+
["mass", {"last"}, {}],
|
26
|
+
// detects anagrams case-insensitively
|
27
|
+
["Orchestra", {"cashregister", "Carthorse", "radishes"}, {"Carthorse"}],
|
28
|
+
// detects anagrams using case-insensitive subject
|
29
|
+
["Orchestra", {"cashregister", "carthorse", "radishes"}, {"carthorse"}],
|
30
|
+
// detects anagrams using case-insensitive possible matches
|
31
|
+
["orchestra", {"cashregister", "Carthorse", "radishes"}, {"Carthorse"}],
|
32
|
+
// does not detect a word as its own anagram
|
33
|
+
["banana", {"Banana"}, {}],
|
34
|
+
// does not detect a anagram if the original word is repeated
|
35
|
+
["go", {"go Go GO"}, {}],
|
36
|
+
// anagrams must use all letters exactly once
|
37
|
+
["tapper", {"patter"}, {}],
|
38
|
+
// capital word is not own anagram
|
39
|
+
["BANANA", {"Banana"}, {}]
|
40
|
+
};
|
42
41
|
|
43
42
|
test
|
44
43
|
parameters(`value cases`)
|
@@ -1,34 +1,33 @@
|
|
1
1
|
import ceylon.test { ... }
|
2
2
|
|
3
|
-
{[String, Boolean]*} cases =>
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
};
|
3
|
+
{[String, Boolean]*} cases => {
|
4
|
+
// paired square brackets
|
5
|
+
["[]", true],
|
6
|
+
// empty string
|
7
|
+
["", true],
|
8
|
+
// unpaired brackets
|
9
|
+
["[[", false],
|
10
|
+
// wrong ordered brackets
|
11
|
+
["}{", false],
|
12
|
+
// paired with whitespace
|
13
|
+
["{ }", true],
|
14
|
+
// simple nested brackets
|
15
|
+
["{[]}", true],
|
16
|
+
// several paired brackets
|
17
|
+
["{}[]", true],
|
18
|
+
// paired and nested brackets
|
19
|
+
["([{}({}[])])", true],
|
20
|
+
// unopened closing brackets
|
21
|
+
["{[)][]}", false],
|
22
|
+
// unpaired and nested brackets
|
23
|
+
["([{])", false],
|
24
|
+
// paired and wrong nested brackets
|
25
|
+
["[({]})", false],
|
26
|
+
// math expression
|
27
|
+
["(((185 + 223.85) * 15) - 543)/2", true],
|
28
|
+
// complex latex expression
|
29
|
+
["\\left(\\begin{array}{cc} \\frac{1}{3} & x\\\\ \\mathrm{e}^{x} &... x^2 \\end{array}\\right)", true]
|
30
|
+
};
|
32
31
|
|
33
32
|
test
|
34
33
|
parameters(`value cases`)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class Error() {}
|
2
|
+
|
3
|
+
Integer|Error largestProduct(String digits, Integer window) {
|
4
|
+
if (window < 0 || window > digits.size) {
|
5
|
+
return Error();
|
6
|
+
}
|
7
|
+
value parsed = [for (d in digits) if (('0'..'9').contains(d)) d.integer - '0'.integer];
|
8
|
+
if (parsed.size < digits.size) {
|
9
|
+
return Error();
|
10
|
+
}
|
11
|
+
value ranges = {for (i in 0..(digits.size - window)) parsed[i:window]};
|
12
|
+
return max({for (r in ranges) r.fold(1)((acc, e) => acc * e)});
|
13
|
+
}
|
data/tracks/ceylon/exercises/largest-series-product/source/largestseriesproduct/SeriesTest.ceylon
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
import ceylon.test { ... }
|
2
|
+
|
3
|
+
{[String, Integer, Integer?]*} cases => {
|
4
|
+
["29", 2, 18],
|
5
|
+
["0123456789", 2, 72],
|
6
|
+
["576802143", 2, 48],
|
7
|
+
["0123456789", 3, 504],
|
8
|
+
["1027839564", 3, 270],
|
9
|
+
["0123456789", 5, 15120],
|
10
|
+
["73167176531330624919225119674426574742355349194934", 6, 23520],
|
11
|
+
["0000", 2, 0],
|
12
|
+
["99099", 3, 0],
|
13
|
+
["123", 4, null],
|
14
|
+
["", 0, 1],
|
15
|
+
["123", 0, 1],
|
16
|
+
["", 1, null],
|
17
|
+
["1234a5", 2, null],
|
18
|
+
["12345", -1, null]
|
19
|
+
};
|
20
|
+
|
21
|
+
test
|
22
|
+
parameters(`value cases`)
|
23
|
+
void testLargestProduct(String digits, Integer window, Integer? expected) {
|
24
|
+
value result = largestProduct(digits, window);
|
25
|
+
if (exists expected) {
|
26
|
+
assertEquals(result, expected);
|
27
|
+
} else if (!is Error result) {
|
28
|
+
fail("should have errored, but got ``result``");
|
29
|
+
}
|
30
|
+
}
|
data/tracks/csharp/config.json
CHANGED
@@ -175,6 +175,13 @@
|
|
175
175
|
"Classes"
|
176
176
|
]
|
177
177
|
},
|
178
|
+
{
|
179
|
+
"slug": "error-handling",
|
180
|
+
"difficulty": 3,
|
181
|
+
"topics": [
|
182
|
+
"Exception handling"
|
183
|
+
]
|
184
|
+
},
|
178
185
|
{
|
179
186
|
"slug": "kindergarten-garden",
|
180
187
|
"difficulty": 3,
|
@@ -535,6 +542,15 @@
|
|
535
542
|
"Algorithms",
|
536
543
|
"Transforming"
|
537
544
|
]
|
545
|
+
},
|
546
|
+
{
|
547
|
+
"slug": "ledger",
|
548
|
+
"difficulty": 5,
|
549
|
+
"topics": [
|
550
|
+
"Globalization",
|
551
|
+
"Text formatting",
|
552
|
+
"Refactoring"
|
553
|
+
]
|
538
554
|
},
|
539
555
|
{
|
540
556
|
"slug": "custom-set",
|
@@ -543,6 +559,15 @@
|
|
543
559
|
"Sets"
|
544
560
|
]
|
545
561
|
},
|
562
|
+
{
|
563
|
+
"slug": "dot-dsl",
|
564
|
+
"difficulty": 5,
|
565
|
+
"topics": [
|
566
|
+
"Domain-specific languages",
|
567
|
+
"Classes",
|
568
|
+
"Equality"
|
569
|
+
]
|
570
|
+
},
|
546
571
|
{
|
547
572
|
"slug": "ocr-numbers",
|
548
573
|
"difficulty": 5,
|
@@ -715,6 +740,14 @@
|
|
715
740
|
"Logic"
|
716
741
|
]
|
717
742
|
},
|
743
|
+
{
|
744
|
+
"slug": "hangman",
|
745
|
+
"difficulty": 8,
|
746
|
+
"topics": [
|
747
|
+
"Reactive programming",
|
748
|
+
"Events"
|
749
|
+
]
|
750
|
+
},
|
718
751
|
{
|
719
752
|
"slug": "diamond",
|
720
753
|
"difficulty": 8,
|
@@ -780,6 +813,14 @@
|
|
780
813
|
"Parsing",
|
781
814
|
"Transforming"
|
782
815
|
]
|
816
|
+
},
|
817
|
+
{
|
818
|
+
"slug": "alphametics",
|
819
|
+
"difficulty": 10,
|
820
|
+
"topics": [
|
821
|
+
"Parsing",
|
822
|
+
"Dictionaries"
|
823
|
+
]
|
783
824
|
}
|
784
825
|
],
|
785
826
|
"deprecated": [
|
@@ -0,0 +1,122 @@
|
|
1
|
+
using NUnit.Framework;
|
2
|
+
using System.Collections.Generic;
|
3
|
+
|
4
|
+
public class AlphameticsTest
|
5
|
+
{
|
6
|
+
[Test]
|
7
|
+
public void Puzzle_with_three_letters()
|
8
|
+
{
|
9
|
+
var actual = Alphametics.Solve("I + BB == ILL");
|
10
|
+
var expected = new Dictionary<char, int>
|
11
|
+
{
|
12
|
+
['I'] = 1,
|
13
|
+
['B'] = 9,
|
14
|
+
['L'] = 0
|
15
|
+
};
|
16
|
+
Assert.That(actual, Is.EqualTo(expected));
|
17
|
+
}
|
18
|
+
|
19
|
+
[Ignore("Remove to run test")]
|
20
|
+
[Test]
|
21
|
+
public void Solution_must_have_unique_value_for_each_letter()
|
22
|
+
{
|
23
|
+
Assert.That(() => Alphametics.Solve("A == B"), Throws.Exception);
|
24
|
+
}
|
25
|
+
|
26
|
+
[Ignore("Remove to run test")]
|
27
|
+
[Test]
|
28
|
+
public void Leading_zero_solution_is_invalid()
|
29
|
+
{
|
30
|
+
Assert.That(() => Alphametics.Solve("ACA + DD == BD"), Throws.Exception);
|
31
|
+
}
|
32
|
+
|
33
|
+
[Ignore("Remove to run test")]
|
34
|
+
[Test]
|
35
|
+
public void Puzzle_with_four_letters()
|
36
|
+
{
|
37
|
+
var actual = Alphametics.Solve("AS + A == MOM");
|
38
|
+
var expected = new Dictionary<char, int>
|
39
|
+
{
|
40
|
+
['A'] = 9,
|
41
|
+
['S'] = 2,
|
42
|
+
['M'] = 1,
|
43
|
+
['O'] = 0
|
44
|
+
};
|
45
|
+
Assert.That(actual, Is.EqualTo(expected));
|
46
|
+
}
|
47
|
+
|
48
|
+
[Ignore("Remove to run test")]
|
49
|
+
[Test]
|
50
|
+
public void Puzzle_with_six_letters()
|
51
|
+
{
|
52
|
+
var actual = Alphametics.Solve("NO + NO + TOO == LATE");
|
53
|
+
var expected = new Dictionary<char, int>
|
54
|
+
{
|
55
|
+
['N'] = 7,
|
56
|
+
['O'] = 4,
|
57
|
+
['T'] = 9,
|
58
|
+
['L'] = 1,
|
59
|
+
['A'] = 0,
|
60
|
+
['E'] = 2
|
61
|
+
};
|
62
|
+
Assert.That(actual, Is.EqualTo(expected));
|
63
|
+
}
|
64
|
+
|
65
|
+
[Ignore("Remove to run test")]
|
66
|
+
[Test]
|
67
|
+
public void Puzzle_with_seven_letters()
|
68
|
+
{
|
69
|
+
var actual = Alphametics.Solve("HE + SEES + THE == LIGHT");
|
70
|
+
var expected = new Dictionary<char, int>
|
71
|
+
{
|
72
|
+
['E'] = 4,
|
73
|
+
['G'] = 2,
|
74
|
+
['H'] = 5,
|
75
|
+
['I'] = 0,
|
76
|
+
['L'] = 1,
|
77
|
+
['S'] = 9,
|
78
|
+
['T'] = 7,
|
79
|
+
};
|
80
|
+
Assert.That(actual, Is.EqualTo(expected));
|
81
|
+
}
|
82
|
+
|
83
|
+
[Ignore("Remove to run test")]
|
84
|
+
[Test]
|
85
|
+
public void Puzzle_with_eight_letters()
|
86
|
+
{
|
87
|
+
var actual = Alphametics.Solve("SEND + MORE == MONEY");
|
88
|
+
var expected = new Dictionary<char, int>
|
89
|
+
{
|
90
|
+
['S'] = 9,
|
91
|
+
['E'] = 5,
|
92
|
+
['N'] = 6,
|
93
|
+
['D'] = 7,
|
94
|
+
['M'] = 1,
|
95
|
+
['O'] = 0,
|
96
|
+
['R'] = 8,
|
97
|
+
['Y'] = 2,
|
98
|
+
};
|
99
|
+
Assert.That(actual, Is.EqualTo(expected));
|
100
|
+
}
|
101
|
+
|
102
|
+
[Ignore("Remove to run test")]
|
103
|
+
[Test]
|
104
|
+
public void Puzzle_with_ten_letters()
|
105
|
+
{
|
106
|
+
var actual = Alphametics.Solve("AND + A + STRONG + OFFENSE + AS + A + GOOD == DEFENSE");
|
107
|
+
var expected = new Dictionary<char, int>
|
108
|
+
{
|
109
|
+
['A'] = 5,
|
110
|
+
['D'] = 3,
|
111
|
+
['E'] = 4,
|
112
|
+
['F'] = 7,
|
113
|
+
['G'] = 8,
|
114
|
+
['N'] = 0,
|
115
|
+
['O'] = 2,
|
116
|
+
['R'] = 1,
|
117
|
+
['S'] = 6,
|
118
|
+
['T'] = 9,
|
119
|
+
};
|
120
|
+
Assert.That(actual, Is.EqualTo(expected));
|
121
|
+
}
|
122
|
+
}
|