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.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/list-ops/canonical-data.json +27 -11
- data/problem-specifications/exercises/rotational-cipher/canonical-data.json +8 -8
- data/tracks/clojure/config.json +0 -2
- data/tracks/dart/config.json +0 -2
- data/tracks/elisp/config.json +0 -2
- data/tracks/elixir/config.json +0 -2
- data/tracks/erlang/config.json +190 -83
- data/tracks/go/config.json +0 -2
- data/tracks/groovy/config.json +55 -17
- data/tracks/idris/config.json +0 -2
- data/tracks/java/POLICIES.md +9 -1
- data/tracks/java/exercises/nucleotide-count/src/example/java/{DNA.java → NucleotideCounter.java} +4 -4
- data/tracks/java/exercises/nucleotide-count/src/test/java/{NucleotideTest.java → NucleotideCounterTest.java} +21 -21
- data/tracks/kotlin/exercises/rotational-cipher/README.md +39 -0
- data/tracks/lfe/config.json +0 -2
- data/tracks/lisp/config.json +4 -6
- data/tracks/lisp/config/exercise_readme.go.tmpl +16 -0
- data/tracks/lisp/exercises/allergies/README.md +84 -0
- data/tracks/lisp/exercises/anagram/README.md +60 -0
- data/tracks/lisp/exercises/atbash-cipher/README.md +81 -0
- data/tracks/lisp/exercises/beer-song/README.md +374 -0
- data/tracks/lisp/exercises/binary/README.md +82 -0
- data/tracks/lisp/exercises/bob/README.md +65 -0
- data/tracks/lisp/exercises/crypto-square/README.md +121 -0
- data/tracks/lisp/exercises/difference-of-squares/README.md +66 -0
- data/tracks/lisp/exercises/etl/README.md +98 -0
- data/tracks/lisp/exercises/gigasecond/README.md +58 -0
- data/tracks/lisp/exercises/grade-school/README.md +89 -0
- data/tracks/lisp/exercises/grains/README.md +81 -0
- data/tracks/lisp/exercises/hamming/README.md +89 -0
- data/tracks/lisp/exercises/leap/README.md +80 -0
- data/tracks/lisp/exercises/meetup/README.md +77 -0
- data/tracks/lisp/exercises/nucleotide-count/README.md +80 -0
- data/tracks/lisp/exercises/pascals-triangle/README.md +68 -0
- data/tracks/lisp/exercises/phone-number/README.md +81 -0
- data/tracks/lisp/exercises/prime-factors/README.md +83 -0
- data/tracks/lisp/exercises/raindrops/README.md +71 -0
- data/tracks/lisp/exercises/rna-transcription/README.md +72 -0
- data/tracks/lisp/exercises/robot-name/README.md +69 -0
- data/tracks/lisp/exercises/roman-numerals/README.md +96 -0
- data/tracks/lisp/exercises/scrabble-score/README.md +91 -0
- data/tracks/lisp/exercises/sieve/README.md +81 -0
- data/tracks/lisp/exercises/space-age/README.md +71 -0
- data/tracks/lisp/exercises/strain/README.md +87 -0
- data/tracks/lisp/exercises/triangle/README.md +73 -0
- data/tracks/lisp/exercises/trinary/README.md +75 -0
- data/tracks/lisp/exercises/word-count/README.md +66 -0
- data/tracks/perl5/config.json +0 -2
- data/tracks/perl6/config.json +0 -2
- data/tracks/php/config.json +0 -2
- data/tracks/pony/config.json +33 -0
- data/tracks/python/exercises/scale-generator/scale_generator_test.py +1 -1
- data/tracks/racket/config.json +0 -2
- data/tracks/ruby/config.json +0 -2
- data/tracks/rust/.gitignore +0 -1
- data/tracks/rust/_test/check-exercises.sh +7 -1
- data/tracks/rust/config.json +11 -0
- data/tracks/rust/config/maintainers.json +54 -0
- data/tracks/rust/exercises/acronym/src/lib.rs +0 -0
- data/tracks/rust/exercises/all-your-base/src/lib.rs +35 -0
- data/tracks/rust/exercises/allergies/src/lib.rs +0 -0
- data/tracks/rust/exercises/alphametics/src/lib.rs +5 -0
- data/tracks/rust/exercises/anagram/src/lib.rs +0 -0
- data/tracks/rust/exercises/atbash-cipher/src/lib.rs +0 -0
- data/tracks/rust/exercises/beer-song/src/lib.rs +0 -0
- data/tracks/rust/exercises/bob/src/lib.rs +0 -0
- data/tracks/rust/exercises/bowling/src/lib.rs +0 -0
- data/tracks/rust/exercises/bracket-push/src/lib.rs +0 -0
- data/tracks/rust/exercises/circular-buffer/src/lib.rs +0 -0
- data/tracks/rust/exercises/custom-set/src/lib.rs +0 -0
- data/tracks/rust/exercises/difference-of-squares/src/lib.rs +0 -0
- data/tracks/rust/exercises/dominoes/src/lib.rs +0 -0
- data/tracks/rust/exercises/etl/src/lib.rs +0 -0
- data/tracks/rust/exercises/forth/src/lib.rs +23 -0
- data/tracks/rust/exercises/gigasecond/src/lib.rs +7 -0
- data/tracks/rust/exercises/grade-school/src/lib.rs +26 -0
- data/tracks/rust/exercises/grains/src/lib.rs +7 -0
- data/tracks/rust/exercises/hamming/src/lib.rs +0 -0
- data/tracks/rust/exercises/hello-world/src/lib.rs +5 -0
- data/tracks/rust/exercises/hexadecimal/src/lib.rs +0 -0
- data/tracks/rust/exercises/largest-series-product/src/lib.rs +0 -0
- data/tracks/rust/exercises/leap/src/lib.rs +0 -0
- data/tracks/rust/exercises/luhn-from/src/lib.rs +0 -0
- data/tracks/rust/exercises/luhn-trait/src/lib.rs +0 -0
- data/tracks/rust/exercises/luhn/src/lib.rs +0 -0
- data/tracks/rust/exercises/minesweeper/src/lib.rs +0 -0
- data/tracks/rust/exercises/nucleotide-codons/src/lib.rs +0 -0
- data/tracks/rust/exercises/nucleotide-count/src/lib.rs +0 -0
- data/tracks/rust/exercises/ocr-numbers/src/lib.rs +7 -0
- data/tracks/rust/exercises/pangram/src/lib.rs +0 -0
- data/tracks/rust/exercises/parallel-letter-frequency/src/lib.rs +0 -0
- data/tracks/rust/exercises/pascals-triangle/src/lib.rs +11 -0
- data/tracks/rust/exercises/phone-number/src/lib.rs +0 -0
- data/tracks/rust/exercises/pig-latin/src/lib.rs +0 -0
- data/tracks/rust/exercises/protein-translation/src/lib.rs +0 -0
- data/tracks/rust/exercises/queen-attack/src/lib.rs +0 -0
- data/tracks/rust/exercises/raindrops/src/lib.rs +0 -0
- data/tracks/rust/exercises/react/src/lib.rs +89 -0
- data/tracks/rust/exercises/rectangles/src/lib.rs +0 -0
- data/tracks/rust/exercises/rna-transcription/src/lib.rs +0 -0
- data/tracks/rust/exercises/robot-name/src/lib.rs +0 -0
- data/tracks/rust/exercises/robot-simulator/src/lib.rs +44 -0
- data/tracks/rust/exercises/roman-numerals/src/lib.rs +0 -0
- data/tracks/rust/exercises/rotational-cipher/src/lib.rs +0 -0
- data/tracks/rust/exercises/run-length-encoding/src/lib.rs +0 -0
- data/tracks/rust/exercises/say/.meta/hints.md +19 -0
- data/tracks/rust/exercises/say/Cargo.lock +4 -0
- data/tracks/rust/exercises/say/Cargo.toml +4 -0
- data/tracks/rust/exercises/say/README.md +122 -0
- data/tracks/rust/exercises/say/example.rs +56 -0
- data/tracks/rust/exercises/say/src/lib.rs +4 -0
- data/tracks/rust/exercises/say/tests/say.rs +130 -0
- data/tracks/rust/exercises/scrabble-score/src/lib.rs +0 -0
- data/tracks/rust/exercises/sieve/src/lib.rs +0 -0
- data/tracks/rust/exercises/space-age/src/lib.rs +35 -0
- data/tracks/rust/exercises/sublist/src/lib.rs +0 -0
- data/tracks/rust/exercises/sum-of-multiples/src/lib.rs +0 -0
- data/tracks/rust/exercises/tournament/src/lib.rs +0 -0
- data/tracks/rust/exercises/triangle/src/lib.rs +0 -0
- data/tracks/rust/exercises/variable-length-quantity/src/lib.rs +9 -0
- data/tracks/rust/exercises/word-count/src/lib.rs +0 -0
- data/tracks/rust/exercises/wordy/src/lib.rs +0 -0
- data/tracks/scheme/config.json +0 -2
- metadata +45 -4
@@ -0,0 +1,75 @@
|
|
1
|
+
# Trinary
|
2
|
+
|
3
|
+
Convert a trinary number, represented as a string (e.g. '102012'), to its
|
4
|
+
decimal equivalent using first principles.
|
5
|
+
|
6
|
+
The program should consider strings specifying an invalid trinary as the
|
7
|
+
value 0.
|
8
|
+
|
9
|
+
Trinary numbers contain three symbols: 0, 1, and 2.
|
10
|
+
|
11
|
+
The last place in a trinary number is the 1's place. The second to last
|
12
|
+
is the 3's place, the third to last is the 9's place, etc.
|
13
|
+
|
14
|
+
```bash
|
15
|
+
# "102012"
|
16
|
+
1 0 2 0 1 2 # the number
|
17
|
+
1*3^5 + 0*3^4 + 2*3^3 + 0*3^2 + 1*3^1 + 2*3^0 # the value
|
18
|
+
243 + 0 + 54 + 0 + 3 + 2 = 302
|
19
|
+
```
|
20
|
+
|
21
|
+
If your language provides a method in the standard library to perform the
|
22
|
+
conversion, pretend it doesn't exist and implement it yourself.
|
23
|
+
|
24
|
+
## Setup
|
25
|
+
|
26
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
27
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
28
|
+
a Lisp implementation and how to run the tests.
|
29
|
+
|
30
|
+
## Formatting
|
31
|
+
|
32
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
33
|
+
nor whether you use spaces or tabs, this is an important consideration
|
34
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
35
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
36
|
+
the code more readable to the human reviewers. Please review your
|
37
|
+
editors settings on how to accomplish this. Below are instructions for
|
38
|
+
popular editors for Common Lisp.
|
39
|
+
|
40
|
+
### VIM
|
41
|
+
|
42
|
+
Use the following commands to ensure VIM uses only spaces for
|
43
|
+
indentation:
|
44
|
+
|
45
|
+
```vimscript
|
46
|
+
:set tabstop=2
|
47
|
+
:set shiftwidth=2
|
48
|
+
:set expandtab
|
49
|
+
```
|
50
|
+
|
51
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
52
|
+
be added to your `~/.vimrc` file to use it all the time.
|
53
|
+
|
54
|
+
### Emacs
|
55
|
+
|
56
|
+
Emacs is very well suited for editing Common Lisp and has many
|
57
|
+
powerful add-on packages available. The only thing that one needs to
|
58
|
+
do with a stock emacs to make it work well with exercism.io is to
|
59
|
+
evaluate the following code:
|
60
|
+
|
61
|
+
`(setq indent-tab-mode nil)`
|
62
|
+
|
63
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
64
|
+
order to have it set whenever Emacs is launched.
|
65
|
+
|
66
|
+
One suggested add-on for Emacs and Common Lisp is
|
67
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
68
|
+
with the REPL; making iterative coding and testing very easy.
|
69
|
+
|
70
|
+
## Source
|
71
|
+
|
72
|
+
All of Computer Science [http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-](http://www.wolframalpha.com/input/?i=binary&a=*C.binary-_*MathWorld-)
|
73
|
+
|
74
|
+
## Submitting Incomplete Solutions
|
75
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,66 @@
|
|
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
|
+
## Setup
|
16
|
+
|
17
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
18
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
19
|
+
a Lisp implementation and how to run the tests.
|
20
|
+
|
21
|
+
## Formatting
|
22
|
+
|
23
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
24
|
+
nor whether you use spaces or tabs, this is an important consideration
|
25
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
26
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
27
|
+
the code more readable to the human reviewers. Please review your
|
28
|
+
editors settings on how to accomplish this. Below are instructions for
|
29
|
+
popular editors for Common Lisp.
|
30
|
+
|
31
|
+
### VIM
|
32
|
+
|
33
|
+
Use the following commands to ensure VIM uses only spaces for
|
34
|
+
indentation:
|
35
|
+
|
36
|
+
```vimscript
|
37
|
+
:set tabstop=2
|
38
|
+
:set shiftwidth=2
|
39
|
+
:set expandtab
|
40
|
+
```
|
41
|
+
|
42
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
43
|
+
be added to your `~/.vimrc` file to use it all the time.
|
44
|
+
|
45
|
+
### Emacs
|
46
|
+
|
47
|
+
Emacs is very well suited for editing Common Lisp and has many
|
48
|
+
powerful add-on packages available. The only thing that one needs to
|
49
|
+
do with a stock emacs to make it work well with exercism.io is to
|
50
|
+
evaluate the following code:
|
51
|
+
|
52
|
+
`(setq indent-tab-mode nil)`
|
53
|
+
|
54
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
55
|
+
order to have it set whenever Emacs is launched.
|
56
|
+
|
57
|
+
One suggested add-on for Emacs and Common Lisp is
|
58
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
59
|
+
with the REPL; making iterative coding and testing very easy.
|
60
|
+
|
61
|
+
## Source
|
62
|
+
|
63
|
+
This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour.
|
64
|
+
|
65
|
+
## Submitting Incomplete Solutions
|
66
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
data/tracks/perl5/config.json
CHANGED
data/tracks/perl6/config.json
CHANGED
data/tracks/php/config.json
CHANGED
data/tracks/pony/config.json
CHANGED
@@ -5,7 +5,10 @@
|
|
5
5
|
"active": false,
|
6
6
|
"exercises": [
|
7
7
|
{
|
8
|
+
"uuid": "cc5f77d1-b94d-4a05-b205-08eaa00bf49e",
|
8
9
|
"slug": "hello-world",
|
10
|
+
"core": false,
|
11
|
+
"unlocked_by": null,
|
9
12
|
"difficulty": 1,
|
10
13
|
"topics": [
|
11
14
|
"primitives",
|
@@ -13,28 +16,40 @@
|
|
13
16
|
]
|
14
17
|
},
|
15
18
|
{
|
19
|
+
"uuid": "f0bcb245-9e02-476c-9470-5f41c9358960",
|
16
20
|
"slug": "difference-of-squares",
|
21
|
+
"core": false,
|
22
|
+
"unlocked_by": null,
|
17
23
|
"difficulty": 1,
|
18
24
|
"topics": [
|
19
25
|
"iterators"
|
20
26
|
]
|
21
27
|
},
|
22
28
|
{
|
29
|
+
"uuid": "3b11a07d-1d32-4dc1-b580-7ceaefa5ddd6",
|
23
30
|
"slug": "bob",
|
31
|
+
"core": false,
|
32
|
+
"unlocked_by": null,
|
24
33
|
"difficulty": 1,
|
25
34
|
"topics": [
|
26
35
|
"strings"
|
27
36
|
]
|
28
37
|
},
|
29
38
|
{
|
39
|
+
"uuid": "c2f970d3-810c-4504-8592-f523b1d61cbb",
|
30
40
|
"slug": "hamming",
|
41
|
+
"core": false,
|
42
|
+
"unlocked_by": null,
|
31
43
|
"difficulty": 1,
|
32
44
|
"topics": [
|
33
45
|
"errors"
|
34
46
|
]
|
35
47
|
},
|
36
48
|
{
|
49
|
+
"uuid": "f4174500-ae74-499a-9f7b-638238a28843",
|
37
50
|
"slug": "leap",
|
51
|
+
"core": false,
|
52
|
+
"unlocked_by": null,
|
38
53
|
"difficulty": 1,
|
39
54
|
"topics": [
|
40
55
|
"math",
|
@@ -42,7 +57,10 @@
|
|
42
57
|
]
|
43
58
|
},
|
44
59
|
{
|
60
|
+
"uuid": "4471c6ee-1dfa-4520-99fb-aa1f9a543053",
|
45
61
|
"slug": "anagram",
|
62
|
+
"core": false,
|
63
|
+
"unlocked_by": null,
|
46
64
|
"difficulty": 1,
|
47
65
|
"topics": [
|
48
66
|
"reference capabilities",
|
@@ -50,7 +68,10 @@
|
|
50
68
|
]
|
51
69
|
},
|
52
70
|
{
|
71
|
+
"uuid": "27087d27-8ca9-48e7-af64-fda35af114f4",
|
53
72
|
"slug": "rna-transcription",
|
73
|
+
"core": false,
|
74
|
+
"unlocked_by": null,
|
54
75
|
"difficulty": 1,
|
55
76
|
"topics": [
|
56
77
|
"strings",
|
@@ -59,7 +80,10 @@
|
|
59
80
|
]
|
60
81
|
},
|
61
82
|
{
|
83
|
+
"uuid": "94829aed-9496-47d4-b43d-ad2f3ea2a839",
|
62
84
|
"slug": "roman-numerals",
|
85
|
+
"core": false,
|
86
|
+
"unlocked_by": null,
|
63
87
|
"difficulty": 2,
|
64
88
|
"topics": [
|
65
89
|
"strings",
|
@@ -68,7 +92,10 @@
|
|
68
92
|
]
|
69
93
|
},
|
70
94
|
{
|
95
|
+
"uuid": "fc48383d-9e1c-49a0-955f-b14bcbd3e801",
|
71
96
|
"slug": "beer-song",
|
97
|
+
"core": false,
|
98
|
+
"unlocked_by": null,
|
72
99
|
"difficulty": 1,
|
73
100
|
"topics": [
|
74
101
|
"strings",
|
@@ -76,7 +103,10 @@
|
|
76
103
|
]
|
77
104
|
},
|
78
105
|
{
|
106
|
+
"uuid": "bd0cb4f4-b1d9-412f-ac35-c4b4136260d7",
|
79
107
|
"slug": "atbash-cipher",
|
108
|
+
"core": false,
|
109
|
+
"unlocked_by": null,
|
80
110
|
"difficulty": 1,
|
81
111
|
"topics": [
|
82
112
|
"strings",
|
@@ -84,7 +114,10 @@
|
|
84
114
|
]
|
85
115
|
},
|
86
116
|
{
|
117
|
+
"uuid": "bb3fa1fd-6472-4806-bd1f-642541437d40",
|
87
118
|
"slug": "pascals-triangle",
|
119
|
+
"core": false,
|
120
|
+
"unlocked_by": null,
|
88
121
|
"difficulty": 1,
|
89
122
|
"topics": [
|
90
123
|
"math",
|
@@ -110,7 +110,7 @@ class ScaleGeneratorTest(unittest.TestCase):
|
|
110
110
|
self.assertEqual(expected, actual)
|
111
111
|
|
112
112
|
def test_enigmatic(self):
|
113
|
-
enigmatic = Scale('G', 'enigmatic', '
|
113
|
+
enigmatic = Scale('G', 'enigmatic', 'mAMMMmm')
|
114
114
|
expected = ['G', 'G#', 'B', 'C#', 'D#', 'F', 'F#']
|
115
115
|
actual = enigmatic.pitches
|
116
116
|
self.assertEqual(expected, actual)
|
data/tracks/racket/config.json
CHANGED
data/tracks/ruby/config.json
CHANGED
data/tracks/rust/.gitignore
CHANGED
@@ -31,7 +31,13 @@ for exercise in $files; do
|
|
31
31
|
# Run in subshell to change workdir without affecting current workdir.
|
32
32
|
(
|
33
33
|
cd $workdir
|
34
|
-
|
34
|
+
|
35
|
+
if [ ! -f src/lib.rs ]; then
|
36
|
+
# https://github.com/exercism/rust/pull/270
|
37
|
+
echo "$exercise is missing a src/lib.rs; please create one (an empty file is acceptable)"
|
38
|
+
exitcode=1
|
39
|
+
fi
|
40
|
+
|
35
41
|
cp example.rs src/lib.rs
|
36
42
|
|
37
43
|
# Overwrite empty Cargo.toml if an example specific file exists
|
data/tracks/rust/config.json
CHANGED
@@ -103,6 +103,17 @@
|
|
103
103
|
"panic"
|
104
104
|
]
|
105
105
|
},
|
106
|
+
{
|
107
|
+
"uuid": "4ba35adb-230b-49a6-adc9-2d3cd9a4c538",
|
108
|
+
"slug": "say",
|
109
|
+
"core": false,
|
110
|
+
"unlocked_by": null,
|
111
|
+
"difficulty": 4,
|
112
|
+
"topics": [
|
113
|
+
"string concatenation",
|
114
|
+
"modulus"
|
115
|
+
]
|
116
|
+
},
|
106
117
|
{
|
107
118
|
"uuid": "4dc9b165-792a-4438-be80-df9aab6f6a9c",
|
108
119
|
"slug": "run-length-encoding",
|
@@ -0,0 +1,54 @@
|
|
1
|
+
{
|
2
|
+
"maintainers": [
|
3
|
+
{
|
4
|
+
"github_username": "IanWhitney",
|
5
|
+
"show_on_website": false,
|
6
|
+
"alumnus": false,
|
7
|
+
"name": null,
|
8
|
+
"bio": null,
|
9
|
+
"link_text": null,
|
10
|
+
"link_url": null,
|
11
|
+
"avatar_url": null
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"github_username": "etrepum",
|
15
|
+
"show_on_website": false,
|
16
|
+
"alumnus": false,
|
17
|
+
"name": null,
|
18
|
+
"bio": null,
|
19
|
+
"link_text": null,
|
20
|
+
"link_url": null,
|
21
|
+
"avatar_url": null
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"github_username": "ijanos",
|
25
|
+
"show_on_website": false,
|
26
|
+
"alumnus": false,
|
27
|
+
"name": null,
|
28
|
+
"bio": null,
|
29
|
+
"link_text": null,
|
30
|
+
"link_url": null,
|
31
|
+
"avatar_url": null
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"github_username": "petertseng",
|
35
|
+
"show_on_website": false,
|
36
|
+
"alumnus": false,
|
37
|
+
"name": null,
|
38
|
+
"bio": null,
|
39
|
+
"link_text": null,
|
40
|
+
"link_url": null,
|
41
|
+
"avatar_url": null
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"github_username": "EduardoBautista",
|
45
|
+
"show_on_website": false,
|
46
|
+
"alumnus": false,
|
47
|
+
"name": null,
|
48
|
+
"bio": null,
|
49
|
+
"link_text": null,
|
50
|
+
"link_url": null,
|
51
|
+
"avatar_url": null
|
52
|
+
}
|
53
|
+
]
|
54
|
+
}
|
File without changes
|
@@ -0,0 +1,35 @@
|
|
1
|
+
///
|
2
|
+
/// Convert a number between two bases.
|
3
|
+
///
|
4
|
+
/// A number is any slice of digits.
|
5
|
+
/// A digit is any unsigned integer (e.g. u8, u16, u32, u64, or usize).
|
6
|
+
/// Bases are specified as unsigned integers.
|
7
|
+
///
|
8
|
+
/// Return an `Err(.)` if the conversion is impossible.
|
9
|
+
/// The tests do not test for specific values inside the `Err(.)`.
|
10
|
+
///
|
11
|
+
///
|
12
|
+
/// You are allowed to change the function signature as long as all test still pass.
|
13
|
+
///
|
14
|
+
///
|
15
|
+
/// Example:
|
16
|
+
/// Input
|
17
|
+
/// number: &[4, 2]
|
18
|
+
/// from_base: 10
|
19
|
+
/// to_base: 2
|
20
|
+
/// Result
|
21
|
+
/// Ok(vec![1, 0, 1, 0, 1, 0])
|
22
|
+
///
|
23
|
+
/// The example corresponds to converting the number 42 from decimal
|
24
|
+
/// which is equivalent to 101010 in binary.
|
25
|
+
///
|
26
|
+
///
|
27
|
+
/// Notes:
|
28
|
+
/// * The empty slice ( "[]" ) is equal to the number 0.
|
29
|
+
/// * Never output leading 0 digits. However, your function must be able to
|
30
|
+
/// process input with leading 0 digits.
|
31
|
+
///
|
32
|
+
#[allow(unused_variables)]
|
33
|
+
pub fn convert(number: &[u32], from_base: u32, to_base: u32) -> Result<Vec<u32>, ()> {
|
34
|
+
unimplemented!()
|
35
|
+
}
|