trackler 2.2.1.0 → 2.2.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/lib/trackler/version.rb +1 -1
  3. data/problem-specifications/exercises/list-ops/canonical-data.json +27 -11
  4. data/problem-specifications/exercises/rotational-cipher/canonical-data.json +8 -8
  5. data/tracks/clojure/config.json +0 -2
  6. data/tracks/dart/config.json +0 -2
  7. data/tracks/elisp/config.json +0 -2
  8. data/tracks/elixir/config.json +0 -2
  9. data/tracks/erlang/config.json +190 -83
  10. data/tracks/go/config.json +0 -2
  11. data/tracks/groovy/config.json +55 -17
  12. data/tracks/idris/config.json +0 -2
  13. data/tracks/java/POLICIES.md +9 -1
  14. data/tracks/java/exercises/nucleotide-count/src/example/java/{DNA.java → NucleotideCounter.java} +4 -4
  15. data/tracks/java/exercises/nucleotide-count/src/test/java/{NucleotideTest.java → NucleotideCounterTest.java} +21 -21
  16. data/tracks/kotlin/exercises/rotational-cipher/README.md +39 -0
  17. data/tracks/lfe/config.json +0 -2
  18. data/tracks/lisp/config.json +4 -6
  19. data/tracks/lisp/config/exercise_readme.go.tmpl +16 -0
  20. data/tracks/lisp/exercises/allergies/README.md +84 -0
  21. data/tracks/lisp/exercises/anagram/README.md +60 -0
  22. data/tracks/lisp/exercises/atbash-cipher/README.md +81 -0
  23. data/tracks/lisp/exercises/beer-song/README.md +374 -0
  24. data/tracks/lisp/exercises/binary/README.md +82 -0
  25. data/tracks/lisp/exercises/bob/README.md +65 -0
  26. data/tracks/lisp/exercises/crypto-square/README.md +121 -0
  27. data/tracks/lisp/exercises/difference-of-squares/README.md +66 -0
  28. data/tracks/lisp/exercises/etl/README.md +98 -0
  29. data/tracks/lisp/exercises/gigasecond/README.md +58 -0
  30. data/tracks/lisp/exercises/grade-school/README.md +89 -0
  31. data/tracks/lisp/exercises/grains/README.md +81 -0
  32. data/tracks/lisp/exercises/hamming/README.md +89 -0
  33. data/tracks/lisp/exercises/leap/README.md +80 -0
  34. data/tracks/lisp/exercises/meetup/README.md +77 -0
  35. data/tracks/lisp/exercises/nucleotide-count/README.md +80 -0
  36. data/tracks/lisp/exercises/pascals-triangle/README.md +68 -0
  37. data/tracks/lisp/exercises/phone-number/README.md +81 -0
  38. data/tracks/lisp/exercises/prime-factors/README.md +83 -0
  39. data/tracks/lisp/exercises/raindrops/README.md +71 -0
  40. data/tracks/lisp/exercises/rna-transcription/README.md +72 -0
  41. data/tracks/lisp/exercises/robot-name/README.md +69 -0
  42. data/tracks/lisp/exercises/roman-numerals/README.md +96 -0
  43. data/tracks/lisp/exercises/scrabble-score/README.md +91 -0
  44. data/tracks/lisp/exercises/sieve/README.md +81 -0
  45. data/tracks/lisp/exercises/space-age/README.md +71 -0
  46. data/tracks/lisp/exercises/strain/README.md +87 -0
  47. data/tracks/lisp/exercises/triangle/README.md +73 -0
  48. data/tracks/lisp/exercises/trinary/README.md +75 -0
  49. data/tracks/lisp/exercises/word-count/README.md +66 -0
  50. data/tracks/perl5/config.json +0 -2
  51. data/tracks/perl6/config.json +0 -2
  52. data/tracks/php/config.json +0 -2
  53. data/tracks/pony/config.json +33 -0
  54. data/tracks/python/exercises/scale-generator/scale_generator_test.py +1 -1
  55. data/tracks/racket/config.json +0 -2
  56. data/tracks/ruby/config.json +0 -2
  57. data/tracks/rust/.gitignore +0 -1
  58. data/tracks/rust/_test/check-exercises.sh +7 -1
  59. data/tracks/rust/config.json +11 -0
  60. data/tracks/rust/config/maintainers.json +54 -0
  61. data/tracks/rust/exercises/acronym/src/lib.rs +0 -0
  62. data/tracks/rust/exercises/all-your-base/src/lib.rs +35 -0
  63. data/tracks/rust/exercises/allergies/src/lib.rs +0 -0
  64. data/tracks/rust/exercises/alphametics/src/lib.rs +5 -0
  65. data/tracks/rust/exercises/anagram/src/lib.rs +0 -0
  66. data/tracks/rust/exercises/atbash-cipher/src/lib.rs +0 -0
  67. data/tracks/rust/exercises/beer-song/src/lib.rs +0 -0
  68. data/tracks/rust/exercises/bob/src/lib.rs +0 -0
  69. data/tracks/rust/exercises/bowling/src/lib.rs +0 -0
  70. data/tracks/rust/exercises/bracket-push/src/lib.rs +0 -0
  71. data/tracks/rust/exercises/circular-buffer/src/lib.rs +0 -0
  72. data/tracks/rust/exercises/custom-set/src/lib.rs +0 -0
  73. data/tracks/rust/exercises/difference-of-squares/src/lib.rs +0 -0
  74. data/tracks/rust/exercises/dominoes/src/lib.rs +0 -0
  75. data/tracks/rust/exercises/etl/src/lib.rs +0 -0
  76. data/tracks/rust/exercises/forth/src/lib.rs +23 -0
  77. data/tracks/rust/exercises/gigasecond/src/lib.rs +7 -0
  78. data/tracks/rust/exercises/grade-school/src/lib.rs +26 -0
  79. data/tracks/rust/exercises/grains/src/lib.rs +7 -0
  80. data/tracks/rust/exercises/hamming/src/lib.rs +0 -0
  81. data/tracks/rust/exercises/hello-world/src/lib.rs +5 -0
  82. data/tracks/rust/exercises/hexadecimal/src/lib.rs +0 -0
  83. data/tracks/rust/exercises/largest-series-product/src/lib.rs +0 -0
  84. data/tracks/rust/exercises/leap/src/lib.rs +0 -0
  85. data/tracks/rust/exercises/luhn-from/src/lib.rs +0 -0
  86. data/tracks/rust/exercises/luhn-trait/src/lib.rs +0 -0
  87. data/tracks/rust/exercises/luhn/src/lib.rs +0 -0
  88. data/tracks/rust/exercises/minesweeper/src/lib.rs +0 -0
  89. data/tracks/rust/exercises/nucleotide-codons/src/lib.rs +0 -0
  90. data/tracks/rust/exercises/nucleotide-count/src/lib.rs +0 -0
  91. data/tracks/rust/exercises/ocr-numbers/src/lib.rs +7 -0
  92. data/tracks/rust/exercises/pangram/src/lib.rs +0 -0
  93. data/tracks/rust/exercises/parallel-letter-frequency/src/lib.rs +0 -0
  94. data/tracks/rust/exercises/pascals-triangle/src/lib.rs +11 -0
  95. data/tracks/rust/exercises/phone-number/src/lib.rs +0 -0
  96. data/tracks/rust/exercises/pig-latin/src/lib.rs +0 -0
  97. data/tracks/rust/exercises/protein-translation/src/lib.rs +0 -0
  98. data/tracks/rust/exercises/queen-attack/src/lib.rs +0 -0
  99. data/tracks/rust/exercises/raindrops/src/lib.rs +0 -0
  100. data/tracks/rust/exercises/react/src/lib.rs +89 -0
  101. data/tracks/rust/exercises/rectangles/src/lib.rs +0 -0
  102. data/tracks/rust/exercises/rna-transcription/src/lib.rs +0 -0
  103. data/tracks/rust/exercises/robot-name/src/lib.rs +0 -0
  104. data/tracks/rust/exercises/robot-simulator/src/lib.rs +44 -0
  105. data/tracks/rust/exercises/roman-numerals/src/lib.rs +0 -0
  106. data/tracks/rust/exercises/rotational-cipher/src/lib.rs +0 -0
  107. data/tracks/rust/exercises/run-length-encoding/src/lib.rs +0 -0
  108. data/tracks/rust/exercises/say/.meta/hints.md +19 -0
  109. data/tracks/rust/exercises/say/Cargo.lock +4 -0
  110. data/tracks/rust/exercises/say/Cargo.toml +4 -0
  111. data/tracks/rust/exercises/say/README.md +122 -0
  112. data/tracks/rust/exercises/say/example.rs +56 -0
  113. data/tracks/rust/exercises/say/src/lib.rs +4 -0
  114. data/tracks/rust/exercises/say/tests/say.rs +130 -0
  115. data/tracks/rust/exercises/scrabble-score/src/lib.rs +0 -0
  116. data/tracks/rust/exercises/sieve/src/lib.rs +0 -0
  117. data/tracks/rust/exercises/space-age/src/lib.rs +35 -0
  118. data/tracks/rust/exercises/sublist/src/lib.rs +0 -0
  119. data/tracks/rust/exercises/sum-of-multiples/src/lib.rs +0 -0
  120. data/tracks/rust/exercises/tournament/src/lib.rs +0 -0
  121. data/tracks/rust/exercises/triangle/src/lib.rs +0 -0
  122. data/tracks/rust/exercises/variable-length-quantity/src/lib.rs +9 -0
  123. data/tracks/rust/exercises/word-count/src/lib.rs +0 -0
  124. data/tracks/rust/exercises/wordy/src/lib.rs +0 -0
  125. data/tracks/scheme/config.json +0 -2
  126. metadata +45 -4
@@ -0,0 +1,5 @@
1
+ use std::collections::HashMap;
2
+
3
+ pub fn solve(puzzle: &str) -> Option<HashMap<char, u8>> {
4
+ unimplemented!()
5
+ }
File without changes
File without changes
@@ -0,0 +1,23 @@
1
+ pub type Value = i32;
2
+ pub type ForthResult = Result<(), Error>;
3
+
4
+ pub struct Forth;
5
+
6
+ #[derive(Debug, PartialEq)]
7
+ pub enum Error {
8
+ DivisionByZero,
9
+ StackUnderflow,
10
+ UnknownWord,
11
+ InvalidWord,
12
+ }
13
+
14
+ impl Forth {
15
+ pub fn new() -> Forth {
16
+ }
17
+
18
+ pub fn stack(&self) -> Vec<Value> {
19
+ }
20
+
21
+ pub fn eval(&mut self, input: &str) -> ForthResult {
22
+ }
23
+ }
@@ -0,0 +1,7 @@
1
+ extern crate chrono;
2
+ use chrono::*;
3
+
4
+ // Returns a Utc DateTime one billion seconds after start.
5
+ pub fn after(start: DateTime<Utc>) -> DateTime<Utc> {
6
+ unimplemented!()
7
+ }
@@ -0,0 +1,26 @@
1
+ #[allow(unused_variables)]
2
+
3
+ pub struct School {
4
+ }
5
+
6
+ impl School {
7
+ pub fn new() -> School {
8
+ unimplemented!()
9
+ }
10
+
11
+ pub fn add(&mut self, grade: u32, student: &str) {
12
+ unimplemented!()
13
+ }
14
+
15
+ pub fn grades(&self) -> Vec<u32> {
16
+ unimplemented!()
17
+ }
18
+
19
+ // If grade returned an `Option<&Vec<String>>`,
20
+ // the internal implementation would be forced to keep a `Vec<String>` to lend out.
21
+ // By returning an owned vector instead,
22
+ // the internal implementation is free to use whatever it chooses.
23
+ pub fn grade(&self, grade: u32) -> Option<Vec<String>> {
24
+ unimplemented!()
25
+ }
26
+ }
@@ -0,0 +1,7 @@
1
+ pub fn square(s: u32) -> u64 {
2
+ unimplemented!();
3
+ }
4
+
5
+ pub fn total() -> u64 {
6
+ unimplemented!();
7
+ }
@@ -0,0 +1,5 @@
1
+ // The &'static here means the return type has a static lifetime.
2
+ // This is a Rust feature that you don't need to worry about now.
3
+ pub fn hello() -> &'static str {
4
+ "Goodbye, World!"
5
+ }
File without changes
File without changes
@@ -0,0 +1,7 @@
1
+ // The code below is a stub. Just enough to satisfy the compiler.
2
+ // In order to pass the tests you can add-to or change any of this code.
3
+
4
+ #[allow(unused_variables)]
5
+ pub fn convert(input: &str) -> Result<String, ()> {
6
+ unimplemented!();
7
+ }
@@ -0,0 +1,11 @@
1
+ pub struct PascalsTriangle;
2
+
3
+ impl PascalsTriangle {
4
+ pub fn new(row_count: u32) -> Self {
5
+ unimplemented!();
6
+ }
7
+
8
+ pub fn rows(&self) -> Vec<Vec<u32>> {
9
+ unimplemented!();
10
+ }
11
+ }
@@ -0,0 +1,89 @@
1
+ #[allow(unused_variables)]
2
+
3
+ // Because these are passed without & to some functions,
4
+ // it will probably be necessary for these two types to be Copy.
5
+ pub type CellID = ();
6
+ pub type CallbackID = ();
7
+
8
+ pub struct Reactor<T> {
9
+ // Just so that the compiler doesn't complain about an unused type parameter.
10
+ // You probably want to delete this field.
11
+ dummy: T,
12
+ }
13
+
14
+ // You are guaranteed that Reactor will only be tested against types that are Copy + PartialEq.
15
+ impl <T: Copy + PartialEq> Reactor<T> {
16
+ pub fn new() -> Self {
17
+ unimplemented!()
18
+ }
19
+
20
+ // Creates an input cell with the specified initial value, returning its ID.
21
+ pub fn create_input(&mut self, initial: T) -> CellID {
22
+ unimplemented!()
23
+ }
24
+
25
+ // Creates a compute cell with the specified dependencies and compute function.
26
+ // The compute function is expected to take in its arguments in the same order as specified in
27
+ // `dependencies`.
28
+ // You do not need to reject compute functions that expect more arguments than there are
29
+ // dependencies (how would you check for this, anyway?).
30
+ //
31
+ // Return an Err (and you can change the error type) if any dependency doesn't exist.
32
+ //
33
+ // Notice that there is no way to *remove* a cell.
34
+ // This means that you may assume, without checking, that if the dependencies exist at creation
35
+ // time they will continue to exist as long as the Reactor exists.
36
+ pub fn create_compute<F: Fn(&[T]) -> T>(&mut self, dependencies: &[CellID], compute_func: F) -> Result<CellID, ()> {
37
+ unimplemented!()
38
+ }
39
+
40
+ // Retrieves the current value of the cell, or None if the cell does not exist.
41
+ //
42
+ // You may wonder whether it is possible to implement `get(&self, id: CellID) -> Option<&Cell>`
43
+ // and have a `value(&self)` method on `Cell`.
44
+ //
45
+ // It turns out this introduces a significant amount of extra complexity to this exercise.
46
+ // We chose not to cover this here, since this exercise is probably enough work as-is.
47
+ pub fn value(&self, id: CellID) -> Option<T> {
48
+ unimplemented!()
49
+ }
50
+
51
+ // Sets the value of the specified input cell.
52
+ //
53
+ // Return an Err (and you can change the error type) if the cell does not exist, or the
54
+ // specified cell is a compute cell, since compute cells cannot have their values directly set.
55
+ //
56
+ // Similarly, you may wonder about `get_mut(&mut self, id: CellID) -> Option<&mut Cell>`, with
57
+ // a `set_value(&mut self, new_value: T)` method on `Cell`.
58
+ //
59
+ // As before, that turned out to add too much extra complexity.
60
+ pub fn set_value(&mut self, id: CellID, new_value: T) -> Result<(), ()> {
61
+ unimplemented!()
62
+ }
63
+
64
+ // Adds a callback to the specified compute cell.
65
+ //
66
+ // Return an Err (and you can change the error type) if the cell does not exist.
67
+ //
68
+ // Callbacks on input cells will not be tested.
69
+ //
70
+ // The semantics of callbacks (as will be tested):
71
+ // For a single set_value call, each compute cell's callbacks should each be called:
72
+ // * Zero times if the compute cell's value did not change as a result of the set_value call.
73
+ // * Exactly once if the compute cell's value changed as a result of the set_value call.
74
+ // The value passed to the callback should be the final value of the compute cell after the
75
+ // set_value call.
76
+ pub fn add_callback<F: FnMut(T) -> ()>(&mut self, id: CellID, callback: F) -> Result<CallbackID, ()> {
77
+ unimplemented!()
78
+ }
79
+
80
+ // Removes the specified callback, using an ID returned from add_callback.
81
+ //
82
+ // Return an Err (and you can change the error type) if either the cell or callback
83
+ // does not exist.
84
+ //
85
+ // A removed callback should no longer be called.
86
+ pub fn remove_callback(&mut self, cell: CellID, callback: CallbackID) -> Result<(), ()> {
87
+ unimplemented!()
88
+ }
89
+ }
@@ -0,0 +1,44 @@
1
+ // The code below is a stub. Just enough to satisfy the compiler.
2
+ // In order to pass the tests you can add-to or change any of this code.
3
+
4
+ #[derive(PartialEq, Debug)]
5
+ pub enum Direction {
6
+ North,
7
+ East,
8
+ South,
9
+ West,
10
+ }
11
+
12
+ pub struct Robot;
13
+
14
+ impl Robot {
15
+ #[allow(unused_variables)]
16
+ pub fn new(x: isize, y: isize, d: Direction) -> Self {
17
+ unimplemented!()
18
+ }
19
+
20
+ pub fn turn_right(self) -> Self {
21
+ unimplemented!()
22
+ }
23
+
24
+ pub fn turn_left(self) -> Self {
25
+ unimplemented!()
26
+ }
27
+
28
+ pub fn advance(self) -> Self {
29
+ unimplemented!()
30
+ }
31
+
32
+ #[allow(unused_variables)]
33
+ pub fn instructions(self, instructions: &str) -> Self {
34
+ unimplemented!()
35
+ }
36
+
37
+ pub fn position(&self) -> (isize, isize) {
38
+ unimplemented!()
39
+ }
40
+
41
+ pub fn direction(&self) -> &Direction {
42
+ unimplemented!()
43
+ }
44
+ }
@@ -0,0 +1,19 @@
1
+
2
+ ## Rust Specific Exercise Notes
3
+
4
+ This is slightly changed in the Rust version, compared to other
5
+ language versions of this exercise. Instead of requiring you to return
6
+ errors for out of range, we are using Rust's strong type system to limit
7
+ input. It is much easier to make a function deal with all valid inputs,
8
+ rather than requiring the user of your module to handle errors.
9
+
10
+ There is a -1 version of a test case, but it is commented out.
11
+ If your function is implemented properly, the -1 test case should not compile.
12
+
13
+ Adding 'and' into number text has not been implemented in test cases.
14
+
15
+ ### Extension
16
+
17
+ Add capability of converting up to the max value for u64: 9,223,372,036,854,775,807.
18
+
19
+ For hints at the output this should have, look at the last test case.
@@ -0,0 +1,4 @@
1
+ [root]
2
+ name = "say"
3
+ version = "1.0.0"
4
+
@@ -0,0 +1,4 @@
1
+ [package]
2
+ name = "say"
3
+ version = "1.0.0"
4
+ authors = ["sacherjj <sacherjj@gmail.com>"]
@@ -0,0 +1,122 @@
1
+ # Say
2
+
3
+ Given a number from 0 to 999,999,999,999, spell out that number in English.
4
+
5
+ ## Step 1
6
+
7
+ Handle the basic case of 0 through 99.
8
+
9
+ If the input to the program is `22`, then the output should be
10
+ `'twenty-two'`.
11
+
12
+ Your program should complain loudly if given a number outside the
13
+ blessed range.
14
+
15
+ Some good test cases for this program are:
16
+
17
+ - 0
18
+ - 14
19
+ - 50
20
+ - 98
21
+ - -1
22
+ - 100
23
+
24
+ ### Extension
25
+
26
+ If you're on a Mac, shell out to Mac OS X's `say` program to talk out
27
+ loud.
28
+
29
+ ## Step 2
30
+
31
+ Implement breaking a number up into chunks of thousands.
32
+
33
+ So `1234567890` should yield a list like 1, 234, 567, and 890, while the
34
+ far simpler `1000` should yield just 1 and 0.
35
+
36
+ The program must also report any values that are out of range.
37
+
38
+ ## Step 3
39
+
40
+ Now handle inserting the appropriate scale word between those chunks.
41
+
42
+ So `1234567890` should yield `'1 billion 234 million 567 thousand 890'`
43
+
44
+ The program must also report any values that are out of range. It's
45
+ fine to stop at "trillion".
46
+
47
+ ## Step 4
48
+
49
+ Put it all together to get nothing but plain English.
50
+
51
+ `12345` should give `twelve thousand three hundred forty-five`.
52
+
53
+ The program must also report any values that are out of range.
54
+
55
+ ### Extensions
56
+
57
+ Use _and_ (correctly) when spelling out the number in English:
58
+
59
+ - 14 becomes "fourteen".
60
+ - 100 becomes "one hundred".
61
+ - 120 becomes "one hundred and twenty".
62
+ - 1002 becomes "one thousand and two".
63
+ - 1323 becomes "one thousand three hundred and twenty-three".
64
+
65
+
66
+ ## Rust Specific Exercise Notes
67
+
68
+ This is slightly changed in the Rust version, compared to other
69
+ language versions of this exercise. Instead of requiring you to return
70
+ errors for out of range, we are using Rust's strong type system to limit
71
+ input. It is much easier to make a function deal with all valid inputs,
72
+ rather than requiring the user of your module to handle errors.
73
+
74
+ There is a -1 version of a test case, but it is commented out.
75
+ If your function is implemented properly, the -1 test case should not compile.
76
+
77
+ Adding 'and' into number text has not been implemented in test cases.
78
+
79
+ ### Extension
80
+
81
+ Add capability of converting up to the max value for u64: 9,223,372,036,854,775,807.
82
+
83
+ For hints at the output this should have, look at the last test case.
84
+
85
+
86
+ ## Rust Installation
87
+
88
+ Refer to the [exercism help page][help-page] for Rust installation and learning
89
+ resources.
90
+
91
+ ## Writing the Code
92
+
93
+ Execute the tests with:
94
+
95
+ ```bash
96
+ $ cargo test
97
+ ```
98
+
99
+ All but the first test have been ignored. After you get the first test to
100
+ pass, remove the ignore flag (`#[ignore]`) from the next test and get the tests
101
+ to pass again. The test file is located in the `tests` directory. You can
102
+ also remove the ignore flag from all the tests to get them to run all at once
103
+ if you wish.
104
+
105
+ Make sure to read the [Crates and Modules](https://doc.rust-lang.org/stable/book/crates-and-modules.html) chapter if you
106
+ haven't already, it will help you with organizing your files.
107
+
108
+ ## Feedback, Issues, Pull Requests
109
+
110
+ The [exercism/rust](https://github.com/exercism/rust) repository on GitHub is the home for all of the Rust exercises. If you have feedback about an exercise, or want to help implement new exercises, head over there and create an issue. Members of the [rust track team](https://github.com/orgs/exercism/teams/rust) are happy to help!
111
+
112
+ If you want to know more about Exercism, take a look at the [contribution guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/README.md).
113
+
114
+ [help-page]: http://exercism.io/languages/rust
115
+ [crates-and-modules]: http://doc.rust-lang.org/stable/book/crates-and-modules.html
116
+
117
+ ## Source
118
+
119
+ A variation on JavaRanch CattleDrive, exercise 4a [http://www.javaranch.com/say.jsp](http://www.javaranch.com/say.jsp)
120
+
121
+ ## Submitting Incomplete Solutions
122
+ It's possible to submit an incomplete solution so you can see how others have completed the exercise.