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,82 @@
|
|
1
|
+
# Binary
|
2
|
+
|
3
|
+
Convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles.
|
4
|
+
|
5
|
+
Implement binary to decimal conversion. Given a binary input
|
6
|
+
string, your program should produce a decimal output. The
|
7
|
+
program should handle invalid inputs.
|
8
|
+
|
9
|
+
## Note
|
10
|
+
- Implement the conversion yourself.
|
11
|
+
Do not use something else to perform the conversion for you.
|
12
|
+
|
13
|
+
## About Binary (Base-2)
|
14
|
+
Decimal is a base-10 system.
|
15
|
+
|
16
|
+
A number 23 in base 10 notation can be understood
|
17
|
+
as a linear combination of powers of 10:
|
18
|
+
|
19
|
+
- The rightmost digit gets multiplied by 10^0 = 1
|
20
|
+
- The next number gets multiplied by 10^1 = 10
|
21
|
+
- ...
|
22
|
+
- The *n*th number gets multiplied by 10^*(n-1)*.
|
23
|
+
- All these values are summed.
|
24
|
+
|
25
|
+
So: `23 => 2*10^1 + 3*10^0 => 2*10 + 3*1 = 23 base 10`
|
26
|
+
|
27
|
+
Binary is similar, but uses powers of 2 rather than powers of 10.
|
28
|
+
|
29
|
+
So: `101 => 1*2^2 + 0*2^1 + 1*2^0 => 1*4 + 0*2 + 1*1 => 4 + 1 => 5 base 10`.
|
30
|
+
|
31
|
+
## Setup
|
32
|
+
|
33
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
34
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
35
|
+
a Lisp implementation and how to run the tests.
|
36
|
+
|
37
|
+
## Formatting
|
38
|
+
|
39
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
40
|
+
nor whether you use spaces or tabs, this is an important consideration
|
41
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
42
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
43
|
+
the code more readable to the human reviewers. Please review your
|
44
|
+
editors settings on how to accomplish this. Below are instructions for
|
45
|
+
popular editors for Common Lisp.
|
46
|
+
|
47
|
+
### VIM
|
48
|
+
|
49
|
+
Use the following commands to ensure VIM uses only spaces for
|
50
|
+
indentation:
|
51
|
+
|
52
|
+
```vimscript
|
53
|
+
:set tabstop=2
|
54
|
+
:set shiftwidth=2
|
55
|
+
:set expandtab
|
56
|
+
```
|
57
|
+
|
58
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
59
|
+
be added to your `~/.vimrc` file to use it all the time.
|
60
|
+
|
61
|
+
### Emacs
|
62
|
+
|
63
|
+
Emacs is very well suited for editing Common Lisp and has many
|
64
|
+
powerful add-on packages available. The only thing that one needs to
|
65
|
+
do with a stock emacs to make it work well with exercism.io is to
|
66
|
+
evaluate the following code:
|
67
|
+
|
68
|
+
`(setq indent-tab-mode nil)`
|
69
|
+
|
70
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
71
|
+
order to have it set whenever Emacs is launched.
|
72
|
+
|
73
|
+
One suggested add-on for Emacs and Common Lisp is
|
74
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
75
|
+
with the REPL; making iterative coding and testing very easy.
|
76
|
+
|
77
|
+
## Source
|
78
|
+
|
79
|
+
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-)
|
80
|
+
|
81
|
+
## Submitting Incomplete Solutions
|
82
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# Bob
|
2
|
+
|
3
|
+
Bob is a lackadaisical teenager. In conversation, his responses are very limited.
|
4
|
+
|
5
|
+
Bob answers 'Sure.' if you ask him a question.
|
6
|
+
|
7
|
+
He answers 'Whoa, chill out!' if you yell at him.
|
8
|
+
|
9
|
+
He says 'Fine. Be that way!' if you address him without actually saying
|
10
|
+
anything.
|
11
|
+
|
12
|
+
He answers 'Whatever.' to anything else.
|
13
|
+
|
14
|
+
## Setup
|
15
|
+
|
16
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
17
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
18
|
+
a Lisp implementation and how to run the tests.
|
19
|
+
|
20
|
+
## Formatting
|
21
|
+
|
22
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
23
|
+
nor whether you use spaces or tabs, this is an important consideration
|
24
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
25
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
26
|
+
the code more readable to the human reviewers. Please review your
|
27
|
+
editors settings on how to accomplish this. Below are instructions for
|
28
|
+
popular editors for Common Lisp.
|
29
|
+
|
30
|
+
### VIM
|
31
|
+
|
32
|
+
Use the following commands to ensure VIM uses only spaces for
|
33
|
+
indentation:
|
34
|
+
|
35
|
+
```vimscript
|
36
|
+
:set tabstop=2
|
37
|
+
:set shiftwidth=2
|
38
|
+
:set expandtab
|
39
|
+
```
|
40
|
+
|
41
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
42
|
+
be added to your `~/.vimrc` file to use it all the time.
|
43
|
+
|
44
|
+
### Emacs
|
45
|
+
|
46
|
+
Emacs is very well suited for editing Common Lisp and has many
|
47
|
+
powerful add-on packages available. The only thing that one needs to
|
48
|
+
do with a stock emacs to make it work well with exercism.io is to
|
49
|
+
evaluate the following code:
|
50
|
+
|
51
|
+
`(setq indent-tab-mode nil)`
|
52
|
+
|
53
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
54
|
+
order to have it set whenever Emacs is launched.
|
55
|
+
|
56
|
+
One suggested add-on for Emacs and Common Lisp is
|
57
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
58
|
+
with the REPL; making iterative coding and testing very easy.
|
59
|
+
|
60
|
+
## Source
|
61
|
+
|
62
|
+
Inspired by the 'Deaf Grandma' exercise in Chris Pine's Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=06](http://pine.fm/LearnToProgram/?Chapter=06)
|
63
|
+
|
64
|
+
## Submitting Incomplete Solutions
|
65
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# Crypto Square
|
2
|
+
|
3
|
+
Implement the classic method for composing secret messages called a square code.
|
4
|
+
|
5
|
+
Given an English text, output the encoded version of that text.
|
6
|
+
|
7
|
+
First, the input is normalized: the spaces and punctuation are removed
|
8
|
+
from the English text and the message is downcased.
|
9
|
+
|
10
|
+
Then, the normalized characters are broken into rows. These rows can be
|
11
|
+
regarded as forming a rectangle when printed with intervening newlines.
|
12
|
+
|
13
|
+
For example, the sentence
|
14
|
+
|
15
|
+
> If man was meant to stay on the ground, god would have given us roots.
|
16
|
+
|
17
|
+
is normalized to:
|
18
|
+
|
19
|
+
> ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots
|
20
|
+
|
21
|
+
The plaintext should be organized in to a rectangle. The size of the
|
22
|
+
rectangle (`r x c`) should be decided by the length of the message,
|
23
|
+
such that `c >= r` and `c - r <= 1`, where `c` is the number of columns
|
24
|
+
and `r` is the number of rows.
|
25
|
+
|
26
|
+
Our normalized text is 54 characters long, dictating a rectangle with
|
27
|
+
`c = 8` and `r = 7`:
|
28
|
+
|
29
|
+
```plain
|
30
|
+
ifmanwas
|
31
|
+
meanttos
|
32
|
+
tayonthe
|
33
|
+
groundgo
|
34
|
+
dwouldha
|
35
|
+
vegivenu
|
36
|
+
sroots
|
37
|
+
```
|
38
|
+
|
39
|
+
The coded message is obtained by reading down the columns going left to
|
40
|
+
right.
|
41
|
+
|
42
|
+
The message above is coded as:
|
43
|
+
|
44
|
+
```plain
|
45
|
+
imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau
|
46
|
+
```
|
47
|
+
|
48
|
+
Output the encoded text in chunks. Phrases that fill perfect squares
|
49
|
+
`(r X r)` should be output in `r`-length chunks separated by spaces.
|
50
|
+
Imperfect squares will have `n` empty spaces. Those spaces should be distributed evenly across the last `n` rows.
|
51
|
+
|
52
|
+
```plain
|
53
|
+
imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau
|
54
|
+
```
|
55
|
+
|
56
|
+
Notice that were we to stack these, we could visually decode the
|
57
|
+
cyphertext back in to the original message:
|
58
|
+
|
59
|
+
```plain
|
60
|
+
imtgdvs
|
61
|
+
fearwer
|
62
|
+
mayoogo
|
63
|
+
anouuio
|
64
|
+
ntnnlvt
|
65
|
+
wttddes
|
66
|
+
aohghn
|
67
|
+
sseoau
|
68
|
+
```
|
69
|
+
|
70
|
+
## Setup
|
71
|
+
|
72
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
73
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
74
|
+
a Lisp implementation and how to run the tests.
|
75
|
+
|
76
|
+
## Formatting
|
77
|
+
|
78
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
79
|
+
nor whether you use spaces or tabs, this is an important consideration
|
80
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
81
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
82
|
+
the code more readable to the human reviewers. Please review your
|
83
|
+
editors settings on how to accomplish this. Below are instructions for
|
84
|
+
popular editors for Common Lisp.
|
85
|
+
|
86
|
+
### VIM
|
87
|
+
|
88
|
+
Use the following commands to ensure VIM uses only spaces for
|
89
|
+
indentation:
|
90
|
+
|
91
|
+
```vimscript
|
92
|
+
:set tabstop=2
|
93
|
+
:set shiftwidth=2
|
94
|
+
:set expandtab
|
95
|
+
```
|
96
|
+
|
97
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
98
|
+
be added to your `~/.vimrc` file to use it all the time.
|
99
|
+
|
100
|
+
### Emacs
|
101
|
+
|
102
|
+
Emacs is very well suited for editing Common Lisp and has many
|
103
|
+
powerful add-on packages available. The only thing that one needs to
|
104
|
+
do with a stock emacs to make it work well with exercism.io is to
|
105
|
+
evaluate the following code:
|
106
|
+
|
107
|
+
`(setq indent-tab-mode nil)`
|
108
|
+
|
109
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
110
|
+
order to have it set whenever Emacs is launched.
|
111
|
+
|
112
|
+
One suggested add-on for Emacs and Common Lisp is
|
113
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
114
|
+
with the REPL; making iterative coding and testing very easy.
|
115
|
+
|
116
|
+
## Source
|
117
|
+
|
118
|
+
J Dalbey's Programming Practice problems [http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html](http://users.csc.calpoly.edu/~jdalbey/103/Projects/ProgrammingPractice.html)
|
119
|
+
|
120
|
+
## Submitting Incomplete Solutions
|
121
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Difference Of Squares
|
2
|
+
|
3
|
+
Find the difference between the square of the sum and the sum of the squares of the first N natural numbers.
|
4
|
+
|
5
|
+
The square of the sum of the first ten natural numbers is
|
6
|
+
(1 + 2 + ... + 10)² = 55² = 3025.
|
7
|
+
|
8
|
+
The sum of the squares of the first ten natural numbers is
|
9
|
+
1² + 2² + ... + 10² = 385.
|
10
|
+
|
11
|
+
Hence the difference between the square of the sum of the first
|
12
|
+
ten natural numbers and the sum of the squares of the first ten
|
13
|
+
natural numbers is 3025 - 385 = 2640.
|
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
|
+
Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6)
|
64
|
+
|
65
|
+
## Submitting Incomplete Solutions
|
66
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# Etl
|
2
|
+
|
3
|
+
We are going to do the `Transform` step of an Extract-Transform-Load.
|
4
|
+
|
5
|
+
### ETL
|
6
|
+
Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so
|
7
|
+
we're going to migrate this."
|
8
|
+
|
9
|
+
(Typically, this is followed by, "We're only going to need to run this
|
10
|
+
once." That's then typically followed by much forehead slapping and
|
11
|
+
moaning about how stupid we could possibly be.)
|
12
|
+
|
13
|
+
### The goal
|
14
|
+
We're going to extract some scrabble scores from a legacy system.
|
15
|
+
|
16
|
+
The old system stored a list of letters per score:
|
17
|
+
|
18
|
+
- 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T",
|
19
|
+
- 2 points: "D", "G",
|
20
|
+
- 3 points: "B", "C", "M", "P",
|
21
|
+
- 4 points: "F", "H", "V", "W", "Y",
|
22
|
+
- 5 points: "K",
|
23
|
+
- 8 points: "J", "X",
|
24
|
+
- 10 points: "Q", "Z",
|
25
|
+
|
26
|
+
The shiny new scrabble system instead stores the score per letter, which
|
27
|
+
makes it much faster and easier to calculate the score for a word. It
|
28
|
+
also stores the letters in lower-case regardless of the case of the
|
29
|
+
input letters:
|
30
|
+
|
31
|
+
- "a" is worth 1 point.
|
32
|
+
- "b" is worth 3 points.
|
33
|
+
- "c" is worth 3 points.
|
34
|
+
- "d" is worth 2 points.
|
35
|
+
- Etc.
|
36
|
+
|
37
|
+
Your mission, should you choose to accept it, is to transform the legacy data
|
38
|
+
format to the shiny new format.
|
39
|
+
|
40
|
+
### Notes
|
41
|
+
|
42
|
+
A final note about scoring, Scrabble is played around the world in a
|
43
|
+
variety of languages, each with its own unique scoring table. For
|
44
|
+
example, an "E" is scored at 2 in the Māori-language version of the
|
45
|
+
game while being scored at 4 in the Hawaiian-language version.
|
46
|
+
|
47
|
+
## Setup
|
48
|
+
|
49
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
50
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
51
|
+
a Lisp implementation and how to run the tests.
|
52
|
+
|
53
|
+
## Formatting
|
54
|
+
|
55
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
56
|
+
nor whether you use spaces or tabs, this is an important consideration
|
57
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
58
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
59
|
+
the code more readable to the human reviewers. Please review your
|
60
|
+
editors settings on how to accomplish this. Below are instructions for
|
61
|
+
popular editors for Common Lisp.
|
62
|
+
|
63
|
+
### VIM
|
64
|
+
|
65
|
+
Use the following commands to ensure VIM uses only spaces for
|
66
|
+
indentation:
|
67
|
+
|
68
|
+
```vimscript
|
69
|
+
:set tabstop=2
|
70
|
+
:set shiftwidth=2
|
71
|
+
:set expandtab
|
72
|
+
```
|
73
|
+
|
74
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
75
|
+
be added to your `~/.vimrc` file to use it all the time.
|
76
|
+
|
77
|
+
### Emacs
|
78
|
+
|
79
|
+
Emacs is very well suited for editing Common Lisp and has many
|
80
|
+
powerful add-on packages available. The only thing that one needs to
|
81
|
+
do with a stock emacs to make it work well with exercism.io is to
|
82
|
+
evaluate the following code:
|
83
|
+
|
84
|
+
`(setq indent-tab-mode nil)`
|
85
|
+
|
86
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
87
|
+
order to have it set whenever Emacs is launched.
|
88
|
+
|
89
|
+
One suggested add-on for Emacs and Common Lisp is
|
90
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
91
|
+
with the REPL; making iterative coding and testing very easy.
|
92
|
+
|
93
|
+
## Source
|
94
|
+
|
95
|
+
The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com)
|
96
|
+
|
97
|
+
## Submitting Incomplete Solutions
|
98
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# Gigasecond
|
2
|
+
|
3
|
+
Calculate the moment when someone has lived for 10^9 seconds.
|
4
|
+
|
5
|
+
A gigasecond is 10^9 (1,000,000,000) seconds.
|
6
|
+
|
7
|
+
## Setup
|
8
|
+
|
9
|
+
Check out [Exercism Help](http://exercism.io/languages/lisp) for instructions to
|
10
|
+
get started writing Common Lisp. That page will explain how to install and setup
|
11
|
+
a Lisp implementation and how to run the tests.
|
12
|
+
|
13
|
+
## Formatting
|
14
|
+
|
15
|
+
While Common Lisp doesn't care about indentation and layout of code,
|
16
|
+
nor whether you use spaces or tabs, this is an important consideration
|
17
|
+
for submissions to exercism.io. Excercism.io's code widget cannot
|
18
|
+
handle mixing of tab and space characters well so using only spaces is recommended to make
|
19
|
+
the code more readable to the human reviewers. Please review your
|
20
|
+
editors settings on how to accomplish this. Below are instructions for
|
21
|
+
popular editors for Common Lisp.
|
22
|
+
|
23
|
+
### VIM
|
24
|
+
|
25
|
+
Use the following commands to ensure VIM uses only spaces for
|
26
|
+
indentation:
|
27
|
+
|
28
|
+
```vimscript
|
29
|
+
:set tabstop=2
|
30
|
+
:set shiftwidth=2
|
31
|
+
:set expandtab
|
32
|
+
```
|
33
|
+
|
34
|
+
(or as a oneliner `:set tabstop=2 shiftwidth=2 expandtab`). This can
|
35
|
+
be added to your `~/.vimrc` file to use it all the time.
|
36
|
+
|
37
|
+
### Emacs
|
38
|
+
|
39
|
+
Emacs is very well suited for editing Common Lisp and has many
|
40
|
+
powerful add-on packages available. The only thing that one needs to
|
41
|
+
do with a stock emacs to make it work well with exercism.io is to
|
42
|
+
evaluate the following code:
|
43
|
+
|
44
|
+
`(setq indent-tab-mode nil)`
|
45
|
+
|
46
|
+
This can be placed in your `~/.emacs` (or `~/.emacs.d/init.el`) in
|
47
|
+
order to have it set whenever Emacs is launched.
|
48
|
+
|
49
|
+
One suggested add-on for Emacs and Common Lisp is
|
50
|
+
[SLIME](https://github.com/slime/slime) which offers tight integration
|
51
|
+
with the REPL; making iterative coding and testing very easy.
|
52
|
+
|
53
|
+
## Source
|
54
|
+
|
55
|
+
Chapter 9 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=09](http://pine.fm/LearnToProgram/?Chapter=09)
|
56
|
+
|
57
|
+
## Submitting Incomplete Solutions
|
58
|
+
It's possible to submit an incomplete solution so you can see how others have completed the exercise.
|