Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exercises/practice/acronym/acronym_spec.moon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import abbreviate from require 'acronym'

describe 'acronym', ->
describe 'acronym:', ->
it 'basic', ->
result = abbreviate 'Portable Network Graphics'
assert.are.equal 'PNG', result
Expand Down
6 changes: 3 additions & 3 deletions exercises/practice/affine-cipher/affine_cipher_spec.moon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import encode, decode from require 'affine_cipher'

describe 'affine-cipher', ->
describe 'encode', ->
describe 'affine-cipher:', ->
describe 'encode:', ->
it 'encode yes', ->
result = encode 'yes', {a: 5, b: 7}
expected = 'xbt'
Expand Down Expand Up @@ -46,7 +46,7 @@ describe 'affine-cipher', ->
f = -> encode 'This is a test.', {a: 6, b: 17}
assert.has.error f, 'a and m must be coprime.'

describe 'decode', ->
describe 'decode:', ->
pending 'decode exercism', ->
result = decode 'tytgn fjr', {a: 3, b: 7}
expected = 'exercism'
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/all-your-base/all_your_base_spec.moon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import rebase from require 'all_your_base'

describe 'all-your-base', ->
describe 'all-your-base:', ->
it 'single bit one to decimal', ->
result = rebase in_base: 2, out_base: 10, digits: {1}
expected = {1}
Expand Down
20 changes: 10 additions & 10 deletions exercises/practice/allergies/allergies_spec.moon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Allergies = require 'allergies'

describe 'allergies', ->
describe 'testing for eggs allergy', ->
describe 'allergies:', ->
describe 'testing for eggs allergy:', ->
it 'not allergic to anything', ->
result = Allergies.allergic_to 'eggs', 0
assert.is_false result
Expand All @@ -22,7 +22,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'eggs', 255
assert.is_true result

describe 'testing for peanuts allergy', ->
describe 'testing for peanuts allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'peanuts', 0
assert.is_false result
Expand All @@ -43,7 +43,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'peanuts', 255
assert.is_true result

describe 'testing for shellfish allergy', ->
describe 'testing for shellfish allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'shellfish', 0
assert.is_false result
Expand All @@ -64,7 +64,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'shellfish', 255
assert.is_true result

describe 'testing for strawberries allergy', ->
describe 'testing for strawberries allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'strawberries', 0
assert.is_false result
Expand All @@ -85,7 +85,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'strawberries', 255
assert.is_true result

describe 'testing for tomatoes allergy', ->
describe 'testing for tomatoes allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'tomatoes', 0
assert.is_false result
Expand All @@ -106,7 +106,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'tomatoes', 255
assert.is_true result

describe 'testing for chocolate allergy', ->
describe 'testing for chocolate allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'chocolate', 0
assert.is_false result
Expand All @@ -127,7 +127,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'chocolate', 255
assert.is_true result

describe 'testing for pollen allergy', ->
describe 'testing for pollen allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'pollen', 0
assert.is_false result
Expand All @@ -148,7 +148,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'pollen', 255
assert.is_true result

describe 'testing for cats allergy', ->
describe 'testing for cats allergy:', ->
pending 'not allergic to anything', ->
result = Allergies.allergic_to 'cats', 0
assert.is_false result
Expand All @@ -169,7 +169,7 @@ describe 'allergies', ->
result = Allergies.allergic_to 'cats', 255
assert.is_true result

describe 'list when:', ->
describe 'list when::', ->
pending 'no allergies', ->
result = Allergies.list 0
expected = {}
Expand Down
60 changes: 30 additions & 30 deletions exercises/practice/alphametics/alphametics_spec.moon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import solve from require 'alphametics'

describe 'alphametics', ->
describe 'alphametics:', ->
-- ----------------------------------------------------------
same_kv = (state, arguments) ->
actual = arguments[1]
Expand All @@ -23,8 +23,8 @@ describe 'alphametics', ->
result = solve puzzle
expected = {
I: 1,
L: 0,
B: 9,
L: 0,
}
assert.is.same_kv result, expected

Expand All @@ -41,8 +41,8 @@ describe 'alphametics', ->
result = solve puzzle
expected = {
A: 9,
C: 0,
B: 1,
C: 0,
}
assert.is.same_kv result, expected

Expand All @@ -62,11 +62,11 @@ describe 'alphametics', ->
result = solve puzzle
expected = {
E: 2,
L: 1,
N: 7,
O: 4,
A: 0,
T: 9,
O: 4,
N: 7,
L: 1,
}
assert.is.same_kv result, expected

Expand All @@ -75,12 +75,12 @@ describe 'alphametics', ->
result = solve puzzle
expected = {
E: 4,
L: 1,
S: 9,
I: 0,
H: 5,
G: 2,
H: 5,
I: 0,
T: 7,
S: 9,
L: 1,
}
assert.is.same_kv result, expected

Expand All @@ -89,46 +89,46 @@ describe 'alphametics', ->
result = solve puzzle
expected = {
E: 5,
D: 7,
S: 9,
R: 8,
Y: 2,
M: 1,
O: 0,
N: 6,
O: 0,
M: 1,
Y: 2,
R: 8,
S: 9,
D: 7,
}
assert.is.same_kv result, expected

pending 'puzzle with ten letters', ->
puzzle = 'AND + A + STRONG + OFFENSE + AS + A + GOOD == DEFENSE'
result = solve puzzle
expected = {
A: 5,
O: 2,
N: 0,
O: 2,
E: 4,
D: 3,
S: 6,
R: 1,
T: 9,
G: 8,
F: 7,
G: 8,
T: 9,
A: 5,
R: 1,
S: 6,
D: 3,
}
assert.is.same_kv result, expected

pending 'puzzle with ten letters and 199 addends', ->
puzzle = 'THIS + A + FIRE + THEREFORE + FOR + ALL + HISTORIES + I + TELL + A + TALE + THAT + FALSIFIES + ITS + TITLE + TIS + A + LIE + THE + TALE + OF + THE + LAST + FIRE + HORSES + LATE + AFTER + THE + FIRST + FATHERS + FORESEE + THE + HORRORS + THE + LAST + FREE + TROLL + TERRIFIES + THE + HORSES + OF + FIRE + THE + TROLL + RESTS + AT + THE + HOLE + OF + LOSSES + IT + IS + THERE + THAT + SHE + STORES + ROLES + OF + LEATHERS + AFTER + SHE + SATISFIES + HER + HATE + OFF + THOSE + FEARS + A + TASTE + RISES + AS + SHE + HEARS + THE + LEAST + FAR + HORSE + THOSE + FAST + HORSES + THAT + FIRST + HEAR + THE + TROLL + FLEE + OFF + TO + THE + FOREST + THE + HORSES + THAT + ALERTS + RAISE + THE + STARES + OF + THE + OTHERS + AS + THE + TROLL + ASSAILS + AT + THE + TOTAL + SHIFT + HER + TEETH + TEAR + HOOF + OFF + TORSO + AS + THE + LAST + HORSE + FORFEITS + ITS + LIFE + THE + FIRST + FATHERS + HEAR + OF + THE + HORRORS + THEIR + FEARS + THAT + THE + FIRES + FOR + THEIR + FEASTS + ARREST + AS + THE + FIRST + FATHERS + RESETTLE + THE + LAST + OF + THE + FIRE + HORSES + THE + LAST + TROLL + HARASSES + THE + FOREST + HEART + FREE + AT + LAST + OF + THE + LAST + TROLL + ALL + OFFER + THEIR + FIRE + HEAT + TO + THE + ASSISTERS + FAR + OFF + THE + TROLL + FASTS + ITS + LIFE + SHORTER + AS + STARS + RISE + THE + HORSES + REST + SAFE + AFTER + ALL + SHARE + HOT + FISH + AS + THEIR + AFFILIATES + TAILOR + A + ROOFS + FOR + THEIR + SAFE == FORTRESSES'
result = solve puzzle
expected = {
L: 2,
A: 1,
O: 6,
E: 0,
T: 9,
S: 4,
R: 3,
I: 7,
H: 8,
L: 2,
E: 0,
F: 5,
H: 8,
A: 1,
R: 3,
S: 4,
T: 9,
}
assert.is.same_kv result, expected
2 changes: 1 addition & 1 deletion exercises/practice/anagram/anagram_spec.moon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
find_anagrams = require 'anagram'

describe 'anagram', ->
describe 'anagram:', ->
it 'no matches', ->
result = find_anagrams 'diaper', {'hello', 'world', 'zombies', 'pants'}
expected = {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ArmstrongNumbers = require 'armstrong_numbers'

describe 'armstrong-numbers', ->
describe 'armstrong-numbers:', ->
it 'Zero is an Armstrong number', ->
result = ArmstrongNumbers.is_armstrong 0
assert.is_true result
Expand Down
6 changes: 3 additions & 3 deletions exercises/practice/atbash-cipher/atbash_cipher_spec.moon
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AtbashCipher = require 'atbash_cipher'

describe 'atbash-cipher', ->
describe 'encode', ->
describe 'atbash-cipher:', ->
describe 'encode:', ->
it 'encode yes', ->
result = AtbashCipher.encode 'yes'
expected = 'bvh'
Expand Down Expand Up @@ -42,7 +42,7 @@ describe 'atbash-cipher', ->
expected = 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt'
assert.are.equal expected, result

describe 'decode', ->
describe 'decode:', ->
pending 'decode exercism', ->
result = AtbashCipher.decode 'vcvix rhn'
expected = 'exercism'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BafflingBirthdays = require 'baffling_birthdays'

describe 'baffling-birthdays', ->
describe 'baffling-birthdays:', ->
-- ----------------------------------------
-- https://lunarmodules.github.io/Penlight/libraries/pl.tablex.html
tablex = require 'pl.tablex'
Expand All @@ -20,7 +20,7 @@ describe 'baffling-birthdays', ->
isLeapYear = (year) -> year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)
-- ----------------------------------------

describe 'shared birthday', ->
describe 'shared birthday:', ->
it 'one birthdate', ->
birthdates = {'2000-01-01'}
assert.is.false BafflingBirthdays.sharedBirthday birthdates
Expand Down Expand Up @@ -57,7 +57,7 @@ describe 'baffling-birthdays', ->
birthdates = {'1966-07-29', '1977-02-12', '2001-12-25', '1980-07-29', '2019-02-12'}
assert.is.true BafflingBirthdays.sharedBirthday birthdates

describe 'random birthdates', ->
describe 'random birthdates:', ->
pending 'generate requested number of birthdates', ->
result = true
for n = 1, 100
Expand Down Expand Up @@ -90,7 +90,7 @@ describe 'baffling-birthdays', ->
notSeen = [day for day,count in pairs days when count == 0]
assert.is.equal 0, #notSeen

describe 'estimated probability of at least one shared birthday', ->
describe 'estimated probability of at least one shared birthday:', ->
pending 'for one person', ->
result = BafflingBirthdays.estimatedProbabilityOfSharedBirthday 1
assert.is.approx_equal 0.0, result
Expand Down
1 change: 1 addition & 0 deletions exercises/practice/bank-account/.meta/spec_generator.moon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error 'bank-account does not use a generator. Please update spec by hand.'
Loading
Loading