From d07ed5f0a844ab309c970158ab38bd8c4c788d0d Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Thu, 28 May 2026 20:27:16 -0700 Subject: [PATCH 1/8] remove trailing whitespace --- exercises/practice/allergies/allergies.spec.coffee | 2 +- exercises/practice/anagram/anagram.spec.coffee | 2 +- exercises/practice/binary-search/.meta/example.coffee | 2 +- exercises/practice/camicia/.meta/example.coffee | 2 +- exercises/practice/camicia/camicia.spec.coffee | 2 +- exercises/practice/diamond/.meta/example.coffee | 4 ++-- .../difference-of-squares.spec.coffee | 2 +- .../practice/dnd-character/dnd-character.spec.coffee | 2 +- exercises/practice/eliuds-eggs/eliuds-eggs.spec.coffee | 2 +- exercises/practice/game-of-life/.meta/example.coffee | 4 ++-- exercises/practice/grade-school/grade-school.spec.coffee | 2 +- exercises/practice/house/.meta/example.coffee | 2 +- exercises/practice/house/house.coffee | 2 +- exercises/practice/knapsack/.meta/example.coffee | 2 +- exercises/practice/leap/leap.spec.coffee | 2 +- exercises/practice/meetup/.meta/example.coffee | 2 +- .../practice/palindrome-products/.meta/example.coffee | 2 +- exercises/practice/pascals-triangle/.meta/example.coffee | 2 +- exercises/practice/pig-latin/pig-latin.spec.coffee | 4 ++-- .../relative-distance/relative-distance.spec.coffee | 2 +- exercises/practice/reverse-string/.meta/example.coffee | 4 ++-- exercises/practice/reverse-string/reverse-string.coffee | 4 ++-- .../practice/roman-numerals/roman-numerals.spec.coffee | 2 +- .../rotational-cipher/rotational-cipher.spec.coffee | 2 +- exercises/practice/saddle-points/.meta/example.coffee | 2 +- .../practice/saddle-points/saddle-points.spec.coffee | 8 ++++---- exercises/practice/satellite/.meta/example.coffee | 6 +++--- exercises/practice/say/.meta/example.coffee | 2 +- exercises/practice/say/say.spec.coffee | 4 ++-- exercises/practice/sieve/sieve.spec.coffee | 2 +- .../practice/split-second-stopwatch/.meta/example.coffee | 4 ++-- .../practice/state-of-tic-tac-toe/.meta/example.coffee | 8 ++++---- exercises/practice/strain/.meta/example.coffee | 2 +- exercises/practice/strain/strain.coffee | 2 +- exercises/practice/triangle/triangle.spec.coffee | 2 +- exercises/practice/yacht/.meta/example.coffee | 2 +- 36 files changed, 51 insertions(+), 51 deletions(-) diff --git a/exercises/practice/allergies/allergies.spec.coffee b/exercises/practice/allergies/allergies.spec.coffee index 0a4bcf7d..d5c19948 100644 --- a/exercises/practice/allergies/allergies.spec.coffee +++ b/exercises/practice/allergies/allergies.spec.coffee @@ -278,4 +278,4 @@ describe "Allergies", -> xit "no allergen score parts without highest valid score", -> allergies = new Allergies 257 result = allergies.list() - expect(result).toEqual ["eggs"] \ No newline at end of file + expect(result).toEqual ["eggs"] diff --git a/exercises/practice/anagram/anagram.spec.coffee b/exercises/practice/anagram/anagram.spec.coffee index 894d2ad3..9bc23127 100644 --- a/exercises/practice/anagram/anagram.spec.coffee +++ b/exercises/practice/anagram/anagram.spec.coffee @@ -98,7 +98,7 @@ describe 'Anagram', -> @addMatchers toContainSameValues: (expected) -> if not @actual? or !(Array.isArray(@actual) || @actual instanceof Set) - @message = -> "Anagram::match should return an array or set but instead returned #{JSON.stringify @actual}." + @message = -> "Anagram::match should return an array or set but instead returned #{JSON.stringify @actual}." return false matches = Array.from @actual diff --git a/exercises/practice/binary-search/.meta/example.coffee b/exercises/practice/binary-search/.meta/example.coffee index 538fa459..e03631c7 100644 --- a/exercises/practice/binary-search/.meta/example.coffee +++ b/exercises/practice/binary-search/.meta/example.coffee @@ -16,4 +16,4 @@ class BinarySearch throw new Error 'value not in array' -module.exports = BinarySearch \ No newline at end of file +module.exports = BinarySearch diff --git a/exercises/practice/camicia/.meta/example.coffee b/exercises/practice/camicia/.meta/example.coffee index 9a91b843..b793c78d 100644 --- a/exercises/practice/camicia/.meta/example.coffee +++ b/exercises/practice/camicia/.meta/example.coffee @@ -50,7 +50,7 @@ class Camicia pile = [] totalTricks++ currentDebt = 0 - + if handA.length == 0 or handB.length == 0 return { status: 'finished', tricks: totalTricks, cards: cardsPlayed } diff --git a/exercises/practice/camicia/camicia.spec.coffee b/exercises/practice/camicia/camicia.spec.coffee index 82885c55..9fdab7ea 100644 --- a/exercises/practice/camicia/camicia.spec.coffee +++ b/exercises/practice/camicia/camicia.spec.coffee @@ -323,4 +323,4 @@ describe 'Camicia', => '9', '8', '9', '9', 'K', 'A' ] results = Camicia.simulateGame playerA, playerB - expect(results).toEqual {status: 'loop', cards: 474, tricks: 66} \ No newline at end of file + expect(results).toEqual {status: 'loop', cards: 474, tricks: 66} diff --git a/exercises/practice/diamond/.meta/example.coffee b/exercises/practice/diamond/.meta/example.coffee index 1e4d1753..b95cf591 100644 --- a/exercises/practice/diamond/.meta/example.coffee +++ b/exercises/practice/diamond/.meta/example.coffee @@ -2,14 +2,14 @@ class Diamond @rows: (letter) -> return 'A' if letter is 'A' - start = 'A'.charCodeAt 0 + start = 'A'.charCodeAt 0 end = letter.charCodeAt 0 size = end - start + 1 diamond = [] # Down to middle of diamond for i in [0...size] - currentChar = String.fromCharCode start + i + currentChar = String.fromCharCode start + i outer = ' '.repeat size - 1 - i if i is 0 line = outer + currentChar + outer diff --git a/exercises/practice/difference-of-squares/difference-of-squares.spec.coffee b/exercises/practice/difference-of-squares/difference-of-squares.spec.coffee index 520cb5d4..be5bd7d8 100644 --- a/exercises/practice/difference-of-squares/difference-of-squares.spec.coffee +++ b/exercises/practice/difference-of-squares/difference-of-squares.spec.coffee @@ -38,4 +38,4 @@ describe 'Difference of Squares', -> xit 'difference of squares 100', -> result = DS.differenceOfSquares 100 - expect(result).toEqual 25164150 \ No newline at end of file + expect(result).toEqual 25164150 diff --git a/exercises/practice/dnd-character/dnd-character.spec.coffee b/exercises/practice/dnd-character/dnd-character.spec.coffee index e1e35e78..a4c70bbb 100644 --- a/exercises/practice/dnd-character/dnd-character.spec.coffee +++ b/exercises/practice/dnd-character/dnd-character.spec.coffee @@ -80,4 +80,4 @@ describe 'D&D Character', -> character.charisma ] for ability in abilities - expect(ability).toEqual ability \ No newline at end of file + expect(ability).toEqual ability diff --git a/exercises/practice/eliuds-eggs/eliuds-eggs.spec.coffee b/exercises/practice/eliuds-eggs/eliuds-eggs.spec.coffee index 6f98e3aa..299ab995 100644 --- a/exercises/practice/eliuds-eggs/eliuds-eggs.spec.coffee +++ b/exercises/practice/eliuds-eggs/eliuds-eggs.spec.coffee @@ -15,4 +15,4 @@ describe "Eliud's Eggs", -> xit '13 eggs', -> result = EliudsEggs.eggCount 2000000000 - expect(result).toEqual 13 \ No newline at end of file + expect(result).toEqual 13 diff --git a/exercises/practice/game-of-life/.meta/example.coffee b/exercises/practice/game-of-life/.meta/example.coffee index 61fd62e6..e92f61d3 100644 --- a/exercises/practice/game-of-life/.meta/example.coffee +++ b/exercises/practice/game-of-life/.meta/example.coffee @@ -14,14 +14,14 @@ class GameOfLife for newRow in [row-1..row+1] for newCol in [col-1..col+1] if (newRow == row && newCol == col) - continue + continue if newRow < 0 || newCol < 0 || newRow >= rows || newCol >= cols continue liveNeighbors += @matrix[newRow][newCol] liveNeighbors - cell = @matrix[row][col] + cell = @matrix[row][col] # Apply the rules if cell == 1 if liveNeighbors < 2 || liveNeighbors > 3 diff --git a/exercises/practice/grade-school/grade-school.spec.coffee b/exercises/practice/grade-school/grade-school.spec.coffee index 1285ced6..2410b7b3 100644 --- a/exercises/practice/grade-school/grade-school.spec.coffee +++ b/exercises/practice/grade-school/grade-school.spec.coffee @@ -114,7 +114,7 @@ describe 'Grade School', -> school.add 'Paul', 3 expect(school.grade 3).toEqual ['Paul'] - xit 'Students are sorted by name in a grade', -> + xit 'Students are sorted by name in a grade', -> school.add 'Franklin', 5 school.add 'Bradley', 5 school.add 'Jeff', 1 diff --git a/exercises/practice/house/.meta/example.coffee b/exercises/practice/house/.meta/example.coffee index 42a85a36..0e6334d5 100644 --- a/exercises/practice/house/.meta/example.coffee +++ b/exercises/practice/house/.meta/example.coffee @@ -40,4 +40,4 @@ class House result.push @verse(i) result.join '\n' -module.exports = House \ No newline at end of file +module.exports = House diff --git a/exercises/practice/house/house.coffee b/exercises/practice/house/house.coffee index 43f18686..03de043a 100644 --- a/exercises/practice/house/house.coffee +++ b/exercises/practice/house/house.coffee @@ -4,4 +4,4 @@ class House @verses: (startVerse, endVerse) -> -module.exports = House \ No newline at end of file +module.exports = House diff --git a/exercises/practice/knapsack/.meta/example.coffee b/exercises/practice/knapsack/.meta/example.coffee index 63a8bb7f..a1da7777 100644 --- a/exercises/practice/knapsack/.meta/example.coffee +++ b/exercises/practice/knapsack/.meta/example.coffee @@ -10,7 +10,7 @@ class Knapsack for i in [1 .. items.length] {weight, value} = items[i - 1] for w in [0 .. maximumWeight] - if weight > w + if weight > w m[i][w] = m[i - 1][w] else m[i][w] = Math.max m[i - 1][w], m[i - 1][w - weight] + value diff --git a/exercises/practice/leap/leap.spec.coffee b/exercises/practice/leap/leap.spec.coffee index 5460dc8f..a8e7608d 100644 --- a/exercises/practice/leap/leap.spec.coffee +++ b/exercises/practice/leap/leap.spec.coffee @@ -26,7 +26,7 @@ describe 'Leap', -> expect(result).toEqual false xit 'year divisible by 400 is leap year', -> - result = Leap.leapYear 2000 + result = Leap.leapYear 2000 expect(result).toEqual true xit 'year divisible by 400 but not by 125 is still a leap year', -> diff --git a/exercises/practice/meetup/.meta/example.coffee b/exercises/practice/meetup/.meta/example.coffee index f5cdb966..f683ed99 100644 --- a/exercises/practice/meetup/.meta/example.coffee +++ b/exercises/practice/meetup/.meta/example.coffee @@ -1,4 +1,4 @@ -# these values are the first day of the month that +# these values are the first day of the month that # qualifies for the "week", except Last which is a sentinel value Weeks = { First: 1 diff --git a/exercises/practice/palindrome-products/.meta/example.coffee b/exercises/practice/palindrome-products/.meta/example.coffee index bc815445..3eee679b 100644 --- a/exercises/practice/palindrome-products/.meta/example.coffee +++ b/exercises/practice/palindrome-products/.meta/example.coffee @@ -48,7 +48,7 @@ class PalindromeProducts factors: resultProducts } - isPalindrome: (number) -> + isPalindrome: (number) -> number.toString() is number.toString().split('').reverse().join('') module.exports = PalindromeProducts diff --git a/exercises/practice/pascals-triangle/.meta/example.coffee b/exercises/practice/pascals-triangle/.meta/example.coffee index eec8ac0c..46a1f5de 100644 --- a/exercises/practice/pascals-triangle/.meta/example.coffee +++ b/exercises/practice/pascals-triangle/.meta/example.coffee @@ -1,4 +1,4 @@ -class PascalsTriangle +class PascalsTriangle rows: (num) -> triangle = [] for i in [0...num] diff --git a/exercises/practice/pig-latin/pig-latin.spec.coffee b/exercises/practice/pig-latin/pig-latin.spec.coffee index d2426f58..35de042f 100644 --- a/exercises/practice/pig-latin/pig-latin.spec.coffee +++ b/exercises/practice/pig-latin/pig-latin.spec.coffee @@ -100,7 +100,7 @@ describe 'Pig Latin', -> expected = "xrayay" expect(results).toEqual expected -describe 'position of y in a word determines if xit is a consonant or a vowel', -> +describe 'position of y in a word determines if xit is a consonant or a vowel', -> xit 'y is treated like a consonant at the beginning of a word', -> results = PigLatin.translate "yellow" expected = "ellowyay" @@ -120,4 +120,4 @@ describe 'position of y in a word determines if xit is a consonant or a vowel', xit 'a whole phrase', -> results = PigLatin.translate "quick fast run" expected = "ickquay astfay unray" - expect(results).toEqual expected \ No newline at end of file + expect(results).toEqual expected diff --git a/exercises/practice/relative-distance/relative-distance.spec.coffee b/exercises/practice/relative-distance/relative-distance.spec.coffee index 2b69f9ae..7d8d615d 100644 --- a/exercises/practice/relative-distance/relative-distance.spec.coffee +++ b/exercises/practice/relative-distance/relative-distance.spec.coffee @@ -4,7 +4,7 @@ describe 'RelativeDistance', -> it 'Direct parent-child relation', -> familyTree = { 'Vera': ['Tomoko'] - 'Tomoko': ['Aditi'] + 'Tomoko': ['Aditi'] } results = RD.degreesOfSeparation familyTree, 'Vera', 'Tomoko' expect(results).toEqual 1 diff --git a/exercises/practice/reverse-string/.meta/example.coffee b/exercises/practice/reverse-string/.meta/example.coffee index 1017f38b..adaf0367 100644 --- a/exercises/practice/reverse-string/.meta/example.coffee +++ b/exercises/practice/reverse-string/.meta/example.coffee @@ -1,5 +1,5 @@ -class ReverseString - @reverse: (str) -> +class ReverseString + @reverse: (str) -> str.split("").reverse().join "" module.exports = ReverseString diff --git a/exercises/practice/reverse-string/reverse-string.coffee b/exercises/practice/reverse-string/reverse-string.coffee index 190f2ded..51f797da 100644 --- a/exercises/practice/reverse-string/reverse-string.coffee +++ b/exercises/practice/reverse-string/reverse-string.coffee @@ -1,4 +1,4 @@ -class ReverseString - @reverse: (str) -> +class ReverseString + @reverse: (str) -> module.exports = ReverseString diff --git a/exercises/practice/roman-numerals/roman-numerals.spec.coffee b/exercises/practice/roman-numerals/roman-numerals.spec.coffee index 3daf211a..1fa1b294 100644 --- a/exercises/practice/roman-numerals/roman-numerals.spec.coffee +++ b/exercises/practice/roman-numerals/roman-numerals.spec.coffee @@ -134,4 +134,4 @@ describe 'RomanNumerals', -> xit '3999 is MMMCMXCIX', -> results = RomanNumerals.convert(3999) expected = "MMMCMXCIX" - expect(results).toEqual expected \ No newline at end of file + expect(results).toEqual expected diff --git a/exercises/practice/rotational-cipher/rotational-cipher.spec.coffee b/exercises/practice/rotational-cipher/rotational-cipher.spec.coffee index 0e293ef3..a1181ac7 100644 --- a/exercises/practice/rotational-cipher/rotational-cipher.spec.coffee +++ b/exercises/practice/rotational-cipher/rotational-cipher.spec.coffee @@ -49,7 +49,7 @@ describe 'Rotational Cipher', -> expected = 'Xiwxmrk 1 2 3 xiwxmrk' expect(result).toEqual expected - xit 'rotate punctuation', -> + xit 'rotate punctuation', -> cipher = new RotationalCipher 21 result = cipher.rotate "Let's eat, Grandma!" expected = "Gzo'n zvo, Bmviyhv!" diff --git a/exercises/practice/saddle-points/.meta/example.coffee b/exercises/practice/saddle-points/.meta/example.coffee index 35c1b6b6..4793c6b7 100644 --- a/exercises/practice/saddle-points/.meta/example.coffee +++ b/exercises/practice/saddle-points/.meta/example.coffee @@ -7,7 +7,7 @@ SaddlePoints = (matrix) -> tallestInEachRow = matrix.map (row) => Math.max row... shortestInEachColumn = [0...columns].map (c) -> Math.min (matrix[r][c] for r in [0...rows])... - + saddlePoints = [] for i in [0...rows] for j in [0...columns] diff --git a/exercises/practice/saddle-points/saddle-points.spec.coffee b/exercises/practice/saddle-points/saddle-points.spec.coffee index 0f40a71d..94352380 100644 --- a/exercises/practice/saddle-points/saddle-points.spec.coffee +++ b/exercises/practice/saddle-points/saddle-points.spec.coffee @@ -5,7 +5,7 @@ describe 'SaddlePoints', -> matrix = [ [9, 8, 7] [5, 3, 2] - [6, 6, 7]] + [6, 6, 7]] results = SaddlePoints matrix expect(results.sort()).toEqual [{row: 2, column: 1}] @@ -66,11 +66,11 @@ describe 'SaddlePoints', -> [1]] results = SaddlePoints matrix expect(results.sort()).toEqual [{row: 2, column: 1} - {row: 4, column: 1}] - + {row: 4, column: 1}] + xit 'can identify that saddle points in a single row matrix are those with the maximum value', -> matrix = [[2, 5, 3, 5]] results = SaddlePoints matrix expect(results.sort()).toEqual [{row: 1, column: 2} {row: 1, column: 4}] - \ No newline at end of file + diff --git a/exercises/practice/satellite/.meta/example.coffee b/exercises/practice/satellite/.meta/example.coffee index c6ee3c46..8f6f1bb8 100644 --- a/exercises/practice/satellite/.meta/example.coffee +++ b/exercises/practice/satellite/.meta/example.coffee @@ -2,19 +2,19 @@ class Satellite @treeFromTraversals: (preorder, inorder) -> if preorder.length != inorder.length throw new Error 'traversals must have the same length' - + uniquePreorder = new Set preorder uniqueInorder = new Set inorder if uniquePreorder.size != preorder.length or uniqueInorder.size != inorder.length throw new Error 'traversals must contain unique items' - + preorderSorted = preorder.slice().sort().join(',') inorderSorted = inorder.slice().sort().join(',') if preorderSorted != inorderSorted throw new Error 'traversals must have the same elements' - + if preorder.length == 0 return {} diff --git a/exercises/practice/say/.meta/example.coffee b/exercises/practice/say/.meta/example.coffee index fc4ebf07..81975b73 100644 --- a/exercises/practice/say/.meta/example.coffee +++ b/exercises/practice/say/.meta/example.coffee @@ -46,7 +46,7 @@ class Say if word is '' return '' if index == 0 - return word + return word if index == 1 return "#{word} thousand" if index == 2 diff --git a/exercises/practice/say/say.spec.coffee b/exercises/practice/say/say.spec.coffee index b40bf2ba..1f0575b7 100644 --- a/exercises/practice/say/say.spec.coffee +++ b/exercises/practice/say/say.spec.coffee @@ -9,7 +9,7 @@ describe 'Say', -> xit 'fourteen', -> expect(Say.say 14).toEqual 'fourteen' - + xit 'twenty', -> expect(Say.say 20).toEqual 'twenty' @@ -50,7 +50,7 @@ describe 'Say', -> expect(Say.say 1000000000).toEqual 'one billion' xit 'a big number', -> - expect(Say.say 987654321123).toEqual 'nine hundred eighty-seven billion ' + + expect(Say.say 987654321123).toEqual 'nine hundred eighty-seven billion ' + 'six hundred fifty-four million ' + 'three hundred twenty-one thousand ' + 'one hundred twenty-three' diff --git a/exercises/practice/sieve/sieve.spec.coffee b/exercises/practice/sieve/sieve.spec.coffee index 16efc6c8..d5291beb 100644 --- a/exercises/practice/sieve/sieve.spec.coffee +++ b/exercises/practice/sieve/sieve.spec.coffee @@ -26,4 +26,4 @@ describe "Sieve", -> 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, - 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]) \ No newline at end of file + 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997]) diff --git a/exercises/practice/split-second-stopwatch/.meta/example.coffee b/exercises/practice/split-second-stopwatch/.meta/example.coffee index f007890d..8976c62c 100644 --- a/exercises/practice/split-second-stopwatch/.meta/example.coffee +++ b/exercises/practice/split-second-stopwatch/.meta/example.coffee @@ -51,11 +51,11 @@ class SplitSecondStopwatch h = Math.floor totalSeconds / 3600 m = Math.floor (totalSeconds % 3600) / 60 s = totalSeconds % 60 - + cleaned = (num) -> str = num.toString() if str.length < 2 then "0#{str}" else str - + "#{cleaned h}:#{cleaned m}:#{cleaned s}" module.exports = SplitSecondStopwatch diff --git a/exercises/practice/state-of-tic-tac-toe/.meta/example.coffee b/exercises/practice/state-of-tic-tac-toe/.meta/example.coffee index 069f4e8b..01fc8cce 100644 --- a/exercises/practice/state-of-tic-tac-toe/.meta/example.coffee +++ b/exercises/practice/state-of-tic-tac-toe/.meta/example.coffee @@ -1,7 +1,7 @@ gamestate = (board) -> xCount = 0 oCount = 0 - + for row in board for cell in row if cell == 'X' @@ -11,7 +11,7 @@ gamestate = (board) -> if oCount > xCount throw new Error 'Wrong turn order: O started' - + if xCount > oCount + 1 throw new Error 'Wrong turn order: X went twice' @@ -20,12 +20,12 @@ gamestate = (board) -> if xWon and oWon throw new Error 'Impossible board: game should have ended after the game was won' - + if xWon if xCount == oCount throw new Error 'Impossible board: game should have ended after the game was won' return 'win' - + if oWon if xCount > oCount throw new Error 'Impossible board: game should have ended after the game was won' diff --git a/exercises/practice/strain/.meta/example.coffee b/exercises/practice/strain/.meta/example.coffee index 61f0e190..4545de73 100644 --- a/exercises/practice/strain/.meta/example.coffee +++ b/exercises/practice/strain/.meta/example.coffee @@ -1,5 +1,5 @@ class Strain - @keep: (lst, predicate) -> + @keep: (lst, predicate) -> x for x in lst when predicate(x) @discard: (lst, predicate) -> diff --git a/exercises/practice/strain/strain.coffee b/exercises/practice/strain/strain.coffee index 3ae4509b..30e8c88f 100644 --- a/exercises/practice/strain/strain.coffee +++ b/exercises/practice/strain/strain.coffee @@ -1,5 +1,5 @@ class Strain - @keep: (lst, predicate) -> + @keep: (lst, predicate) -> @discard: (lst, predicate) -> diff --git a/exercises/practice/triangle/triangle.spec.coffee b/exercises/practice/triangle/triangle.spec.coffee index 20335d02..30fc5d9e 100644 --- a/exercises/practice/triangle/triangle.spec.coffee +++ b/exercises/practice/triangle/triangle.spec.coffee @@ -86,4 +86,4 @@ describe 'Triangle', -> xit 'sides may be floats', -> triangle = new Triangle(0.5, 0.4, 0.6) - expect(triangle.scalene()).toEqual true \ No newline at end of file + expect(triangle.scalene()).toEqual true diff --git a/exercises/practice/yacht/.meta/example.coffee b/exercises/practice/yacht/.meta/example.coffee index 504d3bb0..17609f8a 100644 --- a/exercises/practice/yacht/.meta/example.coffee +++ b/exercises/practice/yacht/.meta/example.coffee @@ -38,7 +38,7 @@ class Yacht return 4 * 6 else if category == 'little straight' sorted = unique(dice).sort() - if isEqual(sorted, [1, 2, 3, 4, 5]) + if isEqual(sorted, [1, 2, 3, 4, 5]) return 30 else if category == 'big straight' sorted = unique(dice).sort() From 2e1da5e712ea100eb30be4aea771bab1cb53d55d Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Thu, 28 May 2026 20:28:56 -0700 Subject: [PATCH 2/8] simplify parentheses --- exercises/practice/allergies/.meta/example.coffee | 2 +- exercises/practice/allergies/allergies.coffee | 2 +- exercises/practice/bank-account/bank-account.coffee | 6 +++--- exercises/practice/circular-buffer/.meta/example.coffee | 4 ++-- exercises/practice/circular-buffer/circular-buffer.coffee | 4 ++-- exercises/practice/clock/clock.coffee | 2 +- exercises/practice/dnd-character/.meta/example.coffee | 4 ++-- exercises/practice/game-of-life/.meta/example.coffee | 2 +- exercises/practice/game-of-life/game-of-life.coffee | 2 +- exercises/practice/grade-school/.meta/example.coffee | 4 ++-- exercises/practice/grade-school/grade-school.coffee | 4 ++-- exercises/practice/grains/.meta/example.coffee | 2 +- exercises/practice/grains/grains.coffee | 2 +- exercises/practice/high-scores/.meta/example.coffee | 6 +++--- exercises/practice/high-scores/high-scores.coffee | 6 +++--- .../palindrome-products/palindrome-products.spec.coffee | 4 ++-- exercises/practice/resistor-color/.meta/example.coffee | 2 +- exercises/practice/resistor-color/resistor-color.coffee | 2 +- 18 files changed, 30 insertions(+), 30 deletions(-) diff --git a/exercises/practice/allergies/.meta/example.coffee b/exercises/practice/allergies/.meta/example.coffee index c8e6cad0..56e238c2 100644 --- a/exercises/practice/allergies/.meta/example.coffee +++ b/exercises/practice/allergies/.meta/example.coffee @@ -15,7 +15,7 @@ class Allergies allergicTo: (allergen) -> @list().some (candidate) -> candidate == allergen - list: () -> + list: -> ALLERGENS.filter (_, i) => @score & (1 << i) module.exports = Allergies diff --git a/exercises/practice/allergies/allergies.coffee b/exercises/practice/allergies/allergies.coffee index 816d099b..9b29c79a 100644 --- a/exercises/practice/allergies/allergies.coffee +++ b/exercises/practice/allergies/allergies.coffee @@ -3,6 +3,6 @@ class Allergies allergicTo: (candidate) -> - list: () -> + list: -> module.exports = Allergies diff --git a/exercises/practice/bank-account/bank-account.coffee b/exercises/practice/bank-account/bank-account.coffee index e9024ea0..d6da33e4 100644 --- a/exercises/practice/bank-account/bank-account.coffee +++ b/exercises/practice/bank-account/bank-account.coffee @@ -1,11 +1,11 @@ class BankAccount constructor: (args) -> - open: () -> + open: -> - close: () -> + close: -> - balance: () -> + balance: -> deposit: (args) -> diff --git a/exercises/practice/circular-buffer/.meta/example.coffee b/exercises/practice/circular-buffer/.meta/example.coffee index 3838e432..aadf7d83 100644 --- a/exercises/practice/circular-buffer/.meta/example.coffee +++ b/exercises/practice/circular-buffer/.meta/example.coffee @@ -7,7 +7,7 @@ class CircularBuffer throw new Error "full buffer" @data.push value - read: () -> + read: -> if !@data.length throw new Error "empty buffer" [head, @data...] = @data @@ -18,7 +18,7 @@ class CircularBuffer @read() @write value - clear: () -> + clear: -> @data = [] module.exports = CircularBuffer diff --git a/exercises/practice/circular-buffer/circular-buffer.coffee b/exercises/practice/circular-buffer/circular-buffer.coffee index 1bdef5d7..bc9e5b5d 100644 --- a/exercises/practice/circular-buffer/circular-buffer.coffee +++ b/exercises/practice/circular-buffer/circular-buffer.coffee @@ -3,10 +3,10 @@ class CircularBuffer write: (value) -> - read: () -> + read: -> overwrite: (value) -> - clear: () -> + clear: -> module.exports = CircularBuffer diff --git a/exercises/practice/clock/clock.coffee b/exercises/practice/clock/clock.coffee index 20c6473b..1fb34f8d 100644 --- a/exercises/practice/clock/clock.coffee +++ b/exercises/practice/clock/clock.coffee @@ -1,7 +1,7 @@ class Clock constructor: (hour, minute) -> - toString: () -> + toString: -> plus: (minutes) -> diff --git a/exercises/practice/dnd-character/.meta/example.coffee b/exercises/practice/dnd-character/.meta/example.coffee index f01bc40b..ba5469d9 100644 --- a/exercises/practice/dnd-character/.meta/example.coffee +++ b/exercises/practice/dnd-character/.meta/example.coffee @@ -1,5 +1,5 @@ class DndCharacter - constructor: () -> + constructor: -> @strength = @ability() @dexterity = @ability() @constitution = @ability() @@ -11,7 +11,7 @@ class DndCharacter modifier: (score) -> (score - 10) // 2 - ability: () -> + ability: -> rolls = [0,0,0,0] .map((a) -> Math.floor(Math.random() * 6) + 1) .sort((a, b) -> a - b)[1..] diff --git a/exercises/practice/game-of-life/.meta/example.coffee b/exercises/practice/game-of-life/.meta/example.coffee index e92f61d3..52739df5 100644 --- a/exercises/practice/game-of-life/.meta/example.coffee +++ b/exercises/practice/game-of-life/.meta/example.coffee @@ -1,7 +1,7 @@ class GameOfLife constructor: (@matrix) -> - tick: () -> + tick: -> return if not @matrix.length rows = @matrix.length diff --git a/exercises/practice/game-of-life/game-of-life.coffee b/exercises/practice/game-of-life/game-of-life.coffee index 87a30a43..f3f8bf18 100644 --- a/exercises/practice/game-of-life/game-of-life.coffee +++ b/exercises/practice/game-of-life/game-of-life.coffee @@ -1,6 +1,6 @@ class GameOfLife constructor: (matrix) -> - tick: () -> + tick: -> module.exports = GameOfLife diff --git a/exercises/practice/grade-school/.meta/example.coffee b/exercises/practice/grade-school/.meta/example.coffee index 15976388..8e7347cf 100644 --- a/exercises/practice/grade-school/.meta/example.coffee +++ b/exercises/practice/grade-school/.meta/example.coffee @@ -1,5 +1,5 @@ class GradeSchool - constructor: () -> + constructor: -> @students = {} add: (student, level) -> @@ -16,7 +16,7 @@ class GradeSchool result.push student result.sort() - roster: () -> + roster: -> result = [] grades = (g for _, g of @students).sort() for g in grades.unique() diff --git a/exercises/practice/grade-school/grade-school.coffee b/exercises/practice/grade-school/grade-school.coffee index c0c7644b..afab85b4 100644 --- a/exercises/practice/grade-school/grade-school.coffee +++ b/exercises/practice/grade-school/grade-school.coffee @@ -1,10 +1,10 @@ class GradeSchool - constructor: () -> + constructor: -> add: (student, level) -> grade: (level) -> - roster: () -> + roster: -> module.exports = GradeSchool diff --git a/exercises/practice/grains/.meta/example.coffee b/exercises/practice/grains/.meta/example.coffee index 6bcc3b29..166f754e 100644 --- a/exercises/practice/grains/.meta/example.coffee +++ b/exercises/practice/grains/.meta/example.coffee @@ -5,6 +5,6 @@ class Grains Math.pow(2, number - 1) - @total: () -> + @total: -> Math.pow(2, 64) - 1 module.exports = Grains diff --git a/exercises/practice/grains/grains.coffee b/exercises/practice/grains/grains.coffee index 3765caea..ae45427a 100644 --- a/exercises/practice/grains/grains.coffee +++ b/exercises/practice/grains/grains.coffee @@ -1,6 +1,6 @@ class Grains @square: (number) -> - @total: () -> + @total: -> module.exports = Grains diff --git a/exercises/practice/high-scores/.meta/example.coffee b/exercises/practice/high-scores/.meta/example.coffee index 9b735e5e..4c9606a2 100644 --- a/exercises/practice/high-scores/.meta/example.coffee +++ b/exercises/practice/high-scores/.meta/example.coffee @@ -1,13 +1,13 @@ class HighScores constructor: (@scores) -> - latest: () -> + latest: -> @scores[@scores.length - 1] - personalBest: () -> + personalBest: -> Math.max.apply null, @scores - personalTopThree: () -> + personalTopThree: -> @scores.slice() .sort((a, b) => b - a) .slice 0, 3 diff --git a/exercises/practice/high-scores/high-scores.coffee b/exercises/practice/high-scores/high-scores.coffee index db3fbbec..e6f0967c 100644 --- a/exercises/practice/high-scores/high-scores.coffee +++ b/exercises/practice/high-scores/high-scores.coffee @@ -1,10 +1,10 @@ class HighScores constructor: (scores) -> - latest: () -> + latest: -> - personalBest: () -> + personalBest: -> - personalTopThree: () -> + personalTopThree: -> module.exports = HighScores diff --git a/exercises/practice/palindrome-products/palindrome-products.spec.coffee b/exercises/practice/palindrome-products/palindrome-products.spec.coffee index 78a06f84..9fdb74ff 100644 --- a/exercises/practice/palindrome-products/palindrome-products.spec.coffee +++ b/exercises/practice/palindrome-products/palindrome-products.spec.coffee @@ -63,11 +63,11 @@ describe 'PalindromeProducts', -> xit 'error result for smallest if min is more than max', -> palindromes = new PalindromeProducts({ maxFactor: 1, minFactor: 10000 }) - expect(() -> palindromes.smallest()).toThrow(new Error('min must be <= max')) + expect(-> palindromes.smallest()).toThrow(new Error('min must be <= max')) xit 'error result for largest if min is more than max', -> palindromes = new PalindromeProducts({ maxFactor: 1, minFactor: 2 }) - expect(() -> palindromes.largest()).toThrow(new Error('min must be <= max')) + expect(-> palindromes.largest()).toThrow(new Error('min must be <= max')) xit 'smallest product does not use the smallest factor', -> palindromes = new PalindromeProducts({ maxFactor: 4000, minFactor: 3215 }) diff --git a/exercises/practice/resistor-color/.meta/example.coffee b/exercises/practice/resistor-color/.meta/example.coffee index 70b9f7db..339b9c4c 100644 --- a/exercises/practice/resistor-color/.meta/example.coffee +++ b/exercises/practice/resistor-color/.meta/example.coffee @@ -15,7 +15,7 @@ class ResistorColor @colorCode: (color) -> @colorBands.indexOf(color) - @colors: () -> + @colors: -> @colorBands module.exports = ResistorColor diff --git a/exercises/practice/resistor-color/resistor-color.coffee b/exercises/practice/resistor-color/resistor-color.coffee index 5f7fead2..e7ccbe32 100644 --- a/exercises/practice/resistor-color/resistor-color.coffee +++ b/exercises/practice/resistor-color/resistor-color.coffee @@ -1,6 +1,6 @@ class ResistorColor @colorCode: (color) -> - @colors: () -> + @colors: -> module.exports = ResistorColor From be34c553ea0739f4b94857007eb3e96ef02f51cd Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Thu, 28 May 2026 20:33:37 -0700 Subject: [PATCH 3/8] fix indentation --- .../practice/acronym/acronym.spec.coffee | 36 +++++------ exercises/practice/change/change.spec.coffee | 2 +- .../dnd-character/dnd-character.spec.coffee | 8 +-- .../kindergarten-garden.spec.coffee | 64 +++++++++---------- 4 files changed, 55 insertions(+), 55 deletions(-) diff --git a/exercises/practice/acronym/acronym.spec.coffee b/exercises/practice/acronym/acronym.spec.coffee index c76a6c36..e7bef7f4 100644 --- a/exercises/practice/acronym/acronym.spec.coffee +++ b/exercises/practice/acronym/acronym.spec.coffee @@ -2,37 +2,37 @@ Acronym = require './acronym' describe "Acronym", -> it "basic", -> - result = Acronym.abbreviate "Portable Network Graphics" - expect(result).toEqual "PNG" + result = Acronym.abbreviate "Portable Network Graphics" + expect(result).toEqual "PNG" xit "lowercase words", -> - result = Acronym.abbreviate "Ruby on Rails" - expect(result).toEqual "ROR" + result = Acronym.abbreviate "Ruby on Rails" + expect(result).toEqual "ROR" xit "punctuation", -> - result = Acronym.abbreviate "First In, First Out" - expect(result).toEqual "FIFO" + result = Acronym.abbreviate "First In, First Out" + expect(result).toEqual "FIFO" xit "all caps word", -> - result = Acronym.abbreviate "GNU Image Manipulation Program" - expect(result).toEqual "GIMP" + result = Acronym.abbreviate "GNU Image Manipulation Program" + expect(result).toEqual "GIMP" xit "punctuation without whitespace", -> - result = Acronym.abbreviate "Complementary metal-oxide semiconductor" - expect(result).toEqual "CMOS" + result = Acronym.abbreviate "Complementary metal-oxide semiconductor" + expect(result).toEqual "CMOS" xit "very long abbreviation", -> - result = Acronym.abbreviate "Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me" - expect(result).toEqual "ROTFLSHTMDCOALM" + result = Acronym.abbreviate "Rolling On The Floor Laughing So Hard That My Dogs Came Over And Licked Me" + expect(result).toEqual "ROTFLSHTMDCOALM" xit "consecutive delimiters", -> - result = Acronym.abbreviate "Something - I made up from thin air" - expect(result).toEqual "SIMUFTA" + result = Acronym.abbreviate "Something - I made up from thin air" + expect(result).toEqual "SIMUFTA" xit "apostrophes", -> - result = Acronym.abbreviate "Halley's Comet" - expect(result).toEqual "HC" + result = Acronym.abbreviate "Halley's Comet" + expect(result).toEqual "HC" xit "underscore emphasis", -> - result = Acronym.abbreviate "The Road _Not_ Taken" - expect(result).toEqual "TRNT" + result = Acronym.abbreviate "The Road _Not_ Taken" + expect(result).toEqual "TRNT" diff --git a/exercises/practice/change/change.spec.coffee b/exercises/practice/change/change.spec.coffee index 295c4665..19de09ef 100644 --- a/exercises/practice/change/change.spec.coffee +++ b/exercises/practice/change/change.spec.coffee @@ -45,7 +45,7 @@ describe 'Change', => xit 'error testing for change smaller than the smallest of coins', => expect -> - Change.findFewestCoins [5, 10], 3 + Change.findFewestCoins [5, 10], 3 .toThrow new Error "can't make target with given coins" xit 'error testing if no combination can add up to target', => diff --git a/exercises/practice/dnd-character/dnd-character.spec.coffee b/exercises/practice/dnd-character/dnd-character.spec.coffee index a4c70bbb..d2419ede 100644 --- a/exercises/practice/dnd-character/dnd-character.spec.coffee +++ b/exercises/practice/dnd-character/dnd-character.spec.coffee @@ -67,11 +67,11 @@ describe 'D&D Character', -> character.charisma ] for ability in abilities - expect(ability in [3..18]).toBeTrue + expect(ability in [3..18]).toBeTrue expect(character.hitpoints).toEqual (10 + character.modifier(character.constitution)) xit 'each ability is only calculated once', -> - abilities = [ + abilities = [ character.strength character.dexterity character.constitution @@ -79,5 +79,5 @@ describe 'D&D Character', -> character.wisdom character.charisma ] - for ability in abilities - expect(ability).toEqual ability + for ability in abilities + expect(ability).toEqual ability diff --git a/exercises/practice/kindergarten-garden/kindergarten-garden.spec.coffee b/exercises/practice/kindergarten-garden/kindergarten-garden.spec.coffee index 70e6f2dd..28e21244 100644 --- a/exercises/practice/kindergarten-garden/kindergarten-garden.spec.coffee +++ b/exercises/practice/kindergarten-garden/kindergarten-garden.spec.coffee @@ -7,67 +7,67 @@ describe "Kindergarten Garden", -> expect(diagram.plants "Alice").toEqual ["radishes", "clover", "grass", "grass"] xit "different garden with single student", -> - diagram = new KindergartenGarden "VC\nRC" - expect(diagram.plants "Alice").toEqual ["violets", "clover", "radishes", "clover"] + diagram = new KindergartenGarden "VC\nRC" + expect(diagram.plants "Alice").toEqual ["violets", "clover", "radishes", "clover"] xit "garden with two students", -> - diagram = new KindergartenGarden "VVCG\nVVRC" - expect(diagram.plants "Bob").toEqual ["clover", "grass", "radishes", "clover"] + diagram = new KindergartenGarden "VVCG\nVVRC" + expect(diagram.plants "Bob").toEqual ["clover", "grass", "radishes", "clover"] describe "multiple students for the same garden with three students", -> xit "second student's garden", -> - diagram = new KindergartenGarden "VVCCGG\nVVCCGG" - expect(diagram.plants "Bob").toEqual ["clover", "clover", "clover", "clover"] + diagram = new KindergartenGarden "VVCCGG\nVVCCGG" + expect(diagram.plants "Bob").toEqual ["clover", "clover", "clover", "clover"] xit "third student's garden", -> - diagram = new KindergartenGarden "VVCCGG\nVVCCGG" - expect(diagram.plants "Charlie").toEqual ["grass", "grass", "grass", "grass"] + diagram = new KindergartenGarden "VVCCGG\nVVCCGG" + expect(diagram.plants "Charlie").toEqual ["grass", "grass", "grass", "grass"] describe "full garden", -> xit "for Alice, first student's garden", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Alice").toEqual ["violets", "radishes", "violets", "radishes"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Alice").toEqual ["violets", "radishes", "violets", "radishes"] xit "for Bob, second student's garden", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Bob").toEqual ["clover", "grass", "clover", "clover"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Bob").toEqual ["clover", "grass", "clover", "clover"] xit "for Charlie", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Charlie").toEqual ["violets", "violets", "clover", "grass"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Charlie").toEqual ["violets", "violets", "clover", "grass"] xit "for David", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "David").toEqual ["radishes", "violets", "clover", "radishes"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "David").toEqual ["radishes", "violets", "clover", "radishes"] xit "for Eve", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Eve").toEqual ["clover", "grass", "radishes", "grass"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Eve").toEqual ["clover", "grass", "radishes", "grass"] xit "for Fred", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Fred").toEqual ["grass", "clover", "violets", "clover"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Fred").toEqual ["grass", "clover", "violets", "clover"] xit "for Ginny", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Ginny").toEqual ["clover", "grass", "grass", "clover"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Ginny").toEqual ["clover", "grass", "grass", "clover"] xit "for Harriet", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Harriet").toEqual ["violets", "radishes", "radishes", "violets"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Harriet").toEqual ["violets", "radishes", "radishes", "violets"] xit "for Ileana", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Ileana").toEqual ["grass", "clover", "violets", "clover"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Ileana").toEqual ["grass", "clover", "violets", "clover"] xit "for Joseph", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Joseph").toEqual ["violets", "clover", "violets", "grass"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Joseph").toEqual ["violets", "clover", "violets", "grass"] xit "for Kincaid, second to last student's garden", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Kincaid").toEqual ["grass", "clover", "clover", "grass"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Kincaid").toEqual ["grass", "clover", "clover", "grass"] xit "for Larry, last student's garden", -> - diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" - expect(diagram.plants "Larry").toEqual ["grass", "violets", "clover", "violets"] + diagram = new KindergartenGarden "VRCGVVRVCGGCCGVRGCVCGCGV\nVRCCCGCRRGVCGCRVVCVGCGCV" + expect(diagram.plants "Larry").toEqual ["grass", "violets", "clover", "violets"] From 78ac440231f01e20b9e6b14dace337580a1bc96d Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Thu, 28 May 2026 20:34:19 -0700 Subject: [PATCH 4/8] Stub fixes --- exercises/practice/nucleotide-count/nucleotide-count.coffee | 2 +- exercises/practice/space-age/space-age.coffee | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/exercises/practice/nucleotide-count/nucleotide-count.coffee b/exercises/practice/nucleotide-count/nucleotide-count.coffee index 0e0edd59..5fd285af 100644 --- a/exercises/practice/nucleotide-count/nucleotide-count.coffee +++ b/exercises/practice/nucleotide-count/nucleotide-count.coffee @@ -1,6 +1,6 @@ class NucleotideCount constructor: (args) -> - @nucleotideCounts = + @nucleotideCounts = {} count: (args) -> diff --git a/exercises/practice/space-age/space-age.coffee b/exercises/practice/space-age/space-age.coffee index 513bca2c..63a39ca6 100644 --- a/exercises/practice/space-age/space-age.coffee +++ b/exercises/practice/space-age/space-age.coffee @@ -3,8 +3,6 @@ class SpaceAge @onMercury: (seconds) -> - @onMercury: (seconds) -> - @onVenus: (seconds) -> @onMars: (seconds) -> From afddb813b77424a42c7ae95e3c761b16269350dc Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Thu, 28 May 2026 20:36:33 -0700 Subject: [PATCH 5/8] Drop starting blank line --- exercises/practice/isbn-verifier/isbn-verifier.spec.coffee | 1 - exercises/practice/raindrops/raindrops.spec.coffee | 1 - exercises/practice/square-root/square-root.spec.coffee | 1 - 3 files changed, 3 deletions(-) diff --git a/exercises/practice/isbn-verifier/isbn-verifier.spec.coffee b/exercises/practice/isbn-verifier/isbn-verifier.spec.coffee index aef77510..c077c766 100644 --- a/exercises/practice/isbn-verifier/isbn-verifier.spec.coffee +++ b/exercises/practice/isbn-verifier/isbn-verifier.spec.coffee @@ -1,4 +1,3 @@ - IsbnVerifier = require './isbn-verifier' describe 'ISBN Verifier', -> diff --git a/exercises/practice/raindrops/raindrops.spec.coffee b/exercises/practice/raindrops/raindrops.spec.coffee index 9dbdd4fa..f1865179 100644 --- a/exercises/practice/raindrops/raindrops.spec.coffee +++ b/exercises/practice/raindrops/raindrops.spec.coffee @@ -1,4 +1,3 @@ - Raindrops = require './raindrops' describe 'Raindrops', -> diff --git a/exercises/practice/square-root/square-root.spec.coffee b/exercises/practice/square-root/square-root.spec.coffee index c4123b0b..caac65ab 100644 --- a/exercises/practice/square-root/square-root.spec.coffee +++ b/exercises/practice/square-root/square-root.spec.coffee @@ -1,4 +1,3 @@ - SquareRoot = require './square-root' describe 'SquareRoot', -> From d7063ea82757986749317929fe59edf8ea4755d1 Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Thu, 28 May 2026 20:40:14 -0700 Subject: [PATCH 6/8] Fix incorrectly indented describe --- exercises/practice/pig-latin/pig-latin.spec.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/pig-latin/pig-latin.spec.coffee b/exercises/practice/pig-latin/pig-latin.spec.coffee index 35de042f..ec95dbf9 100644 --- a/exercises/practice/pig-latin/pig-latin.spec.coffee +++ b/exercises/practice/pig-latin/pig-latin.spec.coffee @@ -100,7 +100,7 @@ describe 'Pig Latin', -> expected = "xrayay" expect(results).toEqual expected -describe 'position of y in a word determines if xit is a consonant or a vowel', -> + describe 'position of y in a word determines if xit is a consonant or a vowel', -> xit 'y is treated like a consonant at the beginning of a word', -> results = PigLatin.translate "yellow" expected = "ellowyay" From f883169f2b73701bf7fb855ed52e2f29175d0877 Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Fri, 29 May 2026 20:10:57 -0700 Subject: [PATCH 7/8] Split long lines --- .../practice/anagram/anagram.spec.coffee | 4 +- .../atbash-cipher/atbash-cipher.spec.coffee | 3 +- .../parallel-letter-frequency.spec.coffee | 69 +++++++++++++------ .../pascals-triangle.spec.coffee | 14 +++- .../relative-distance.spec.coffee | 3 +- .../practice/satellite/satellite.spec.coffee | 4 +- 6 files changed, 70 insertions(+), 27 deletions(-) diff --git a/exercises/practice/anagram/anagram.spec.coffee b/exercises/practice/anagram/anagram.spec.coffee index 9bc23127..849fd8b8 100644 --- a/exercises/practice/anagram/anagram.spec.coffee +++ b/exercises/practice/anagram/anagram.spec.coffee @@ -103,6 +103,8 @@ describe 'Anagram', -> matches = Array.from @actual if matches.length != expected.length or not matches.every((value) -> expected.includes value) - @message = -> "Expected returned values (#{matches.join(', ')}) to be equal to expected values (#{expected.join(', ')})." + @message = -> + "Expected returned values (#{matches.join(', ')}) to be equal to expected values " + + "(#{expected.join(', ')})." return false true diff --git a/exercises/practice/atbash-cipher/atbash-cipher.spec.coffee b/exercises/practice/atbash-cipher/atbash-cipher.spec.coffee index 584c90da..ccc5c4bb 100644 --- a/exercises/practice/atbash-cipher/atbash-cipher.spec.coffee +++ b/exercises/practice/atbash-cipher/atbash-cipher.spec.coffee @@ -23,7 +23,8 @@ describe 'Atbash', -> expect(Atbash.encode('Truth is fiction.')).toBe 'gifgs rhurx grlm' xit 'encodes all the things', -> - expect(Atbash.encode('The quick brown fox jumps over the lazy dog.')).toBe 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' + phrase = 'The quick brown fox jumps over the lazy dog.' + expect(Atbash.encode(phrase)).toBe 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt' xit 'decodes exercism', -> expect(Atbash.decode('vcvix rhn')).toBe 'exercism' diff --git a/exercises/practice/parallel-letter-frequency/parallel-letter-frequency.spec.coffee b/exercises/practice/parallel-letter-frequency/parallel-letter-frequency.spec.coffee index 20d979ca..a60cd6c5 100644 --- a/exercises/practice/parallel-letter-frequency/parallel-letter-frequency.spec.coffee +++ b/exercises/practice/parallel-letter-frequency/parallel-letter-frequency.spec.coffee @@ -69,7 +69,11 @@ describe 'Parallel Letter Frequency', -> xit 'combination of lower- and uppercase letters, punctuation and white space', testAsync -> texts = [ - "There, peeping among the cloud-wrack above a dark tower high up in the mountains, Sam saw a white star twinkle for a while. The beauty of it smote his heart, as he looked up out of the forsaken land, and hope returned to him. For like a shaft, clear and cold, the thought pierced him that in the end, the shadow was only a small and passing thing: there was light and high beauty forever beyond its reach." + """There, peeping among the cloud-wrack above a dark tower high up in the mountains, Sam saw a white +star twinkle for a while. The beauty of it smote his heart, as he looked up out of the forsaken +land, and hope returned to him. For like a shaft, clear and cold, the thought pierced him that in +the end, the shadow was only a small and passing thing: there was light and high beauty forever +beyond its reach.""" ] expected = { "a": 32, "b": 4, "c": 6, "d": 14, "e": 37, "f": 7, "g": 8, "h": 29, "i": 19, @@ -193,34 +197,55 @@ they would simply have to take it, this advantage, and add it to the list. But t advantage does not fall under any classification and is not in place in any list. I have a friend for instance ... Ech! gentlemen, but of course he is your friend, too; and indeed there is no one, no one to whom he is not a friend!""" """Yes, but here I come to a stop! Gentlemen, you must excuse me for being over-philosophical; -it's the result of forty years underground! Allow me to indulge my fancy. You see, gentlemen, reason is an excellent thing, +it's the result of forty years underground! Allow me to indulge my fancy. You see, gentlemen, reason is an +excellent thing, there's no disputing that, but reason is nothing but reason and satisfies only the rational side of man's nature, while will is a manifestation of the whole life, that is, of the whole human life including reason and all the impulses. -And although our life, in this manifestation of it, is often worthless, yet it is life and not simply extracting square roots. -Here I, for instance, quite naturally want to live, in order to satisfy all my capacities for life, and not simply my capacity -for reasoning, that is, not simply one twentieth of my capacity for life. What does reason know? Reason only knows what it has +And although our life, in this manifestation of it, is often worthless, yet it is life and not simply extracting +square roots. +Here I, for instance, quite naturally want to live, in order to satisfy all my capacities for life, and not simply +my capacity +for reasoning, that is, not simply one twentieth of my capacity for life. What does reason know? Reason only knows +what it has succeeded in learning (some things, perhaps, it will never learn; this is a poor comfort, but why not say so frankly?) -and human nature acts as a whole, with everything that is in it, consciously or unconsciously, and, even it if goes wrong, it lives. -I suspect, gentlemen, that you are looking at me with compassion; you tell me again that an enlightened and developed man, -such, in short, as the future man will be, cannot consciously desire anything disadvantageous to himself, that that can be proved mathematically. -I thoroughly agree, it can - by mathematics. But I repeat for the hundredth time, there is one case, one only, when man may consciously, purposely, -desire what is injurious to himself, what is stupid, very stupid - simply in order to have the right to desire for himself even what is very stupid -and not to be bound by an obligation to desire only what is sensible. Of course, this very stupid thing, this caprice of ours, may be in reality, -gentlemen, more advantageous for us than anything else on earth, especially in certain cases. And in particular it may be more advantageous than -any advantage even when it does us obvious harm, and contradicts the soundest conclusions of our reason concerning our advantage - -for in any circumstances it preserves for us what is most precious and most important - that is, our personality, our individuality. -Some, you see, maintain that this really is the most precious thing for mankind; choice can, of course, if it chooses, be in agreement -with reason; and especially if this be not abused but kept within bounds. It is profitable and some- times even praiseworthy. -But very often, and even most often, choice is utterly and stubbornly opposed to reason ... and ... and ... do you know that that, -too, is profitable, sometimes even praiseworthy? Gentlemen, let us suppose that man is not stupid. (Indeed one cannot refuse to suppose that, -if only from the one consideration, that, if man is stupid, then who is wise?) But if he is not stupid, he is monstrously ungrateful! -Phenomenally ungrateful. In fact, I believe that the best definition of man is the ungrateful biped. But that is not all, that is not his worst defect; -his worst defect is his perpetual moral obliquity, perpetual - from the days of the Flood to the Schleswig-Holstein period.""" +and human nature acts as a whole, with everything that is in it, consciously or unconsciously, and, even it if goes +wrong, it lives. +I suspect, gentlemen, that you are looking at me with compassion; you tell me again that an enlightened and +developed man, +such, in short, as the future man will be, cannot consciously desire anything disadvantageous to himself, that that +can be proved mathematically. +I thoroughly agree, it can - by mathematics. But I repeat for the hundredth time, there is one case, one only, when +man may consciously, purposely, +desire what is injurious to himself, what is stupid, very stupid - simply in order to have the right to desire for +himself even what is very stupid +and not to be bound by an obligation to desire only what is sensible. Of course, this very stupid thing, this +caprice of ours, may be in reality, +gentlemen, more advantageous for us than anything else on earth, especially in certain cases. And in particular it +may be more advantageous than +any advantage even when it does us obvious harm, and contradicts the soundest conclusions of our reason concerning +our advantage - +for in any circumstances it preserves for us what is most precious and most important - that is, our personality, +our individuality. +Some, you see, maintain that this really is the most precious thing for mankind; choice can, of course, if it +chooses, be in agreement +with reason; and especially if this be not abused but kept within bounds. It is profitable and some- times even +praiseworthy. +But very often, and even most often, choice is utterly and stubbornly opposed to reason ... and ... and ... do you +know that that, +too, is profitable, sometimes even praiseworthy? Gentlemen, let us suppose that man is not stupid. (Indeed one +cannot refuse to suppose that, +if only from the one consideration, that, if man is stupid, then who is wise?) But if he is not stupid, he is +monstrously ungrateful! +Phenomenally ungrateful. In fact, I believe that the best definition of man is the ungrateful biped. But that is +not all, that is not his worst defect; +his worst defect is his perpetual moral obliquity, perpetual - from the days of the Flood to the Schleswig-Holstein +period.""" ] expected = { "a": 845, "b": 155, "c": 278, "d": 359, "e": 1143, "f": 222, "g": 187, "h": 507, "i": 791, "j": 12, "k": 67, "l": 423, "m": 288, "n": 833, "o": 791, "p": 197, - "q": 8, "r": 432, "s": 700, "t": 1043, "u": 325, "v": 111, "w": 223, "x": 7, "y": 251 + "q": 8, "r": 432, "s": 700, "t": 1043, "u": 325, "v": 111, + "w": 223, "x": 7, "y": 251 } PLF.parallelLetterFrequency(texts).then (result) -> expect(result).toEqual expected diff --git a/exercises/practice/pascals-triangle/pascals-triangle.spec.coffee b/exercises/practice/pascals-triangle/pascals-triangle.spec.coffee index b694bac2..ff6935f1 100644 --- a/exercises/practice/pascals-triangle/pascals-triangle.spec.coffee +++ b/exercises/practice/pascals-triangle/pascals-triangle.spec.coffee @@ -31,4 +31,16 @@ describe 'Pascal', -> xit 'ten rows', -> pascal = new PascalsTriangle() - expect(pascal.rows(10)).toEqual [[1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1], [1, 5, 10, 10, 5, 1], [1, 6, 15, 20, 15, 6, 1], [1, 7, 21, 35, 35, 21, 7, 1], [1, 8, 28, 56, 70, 56, 28, 8, 1], [1, 9, 36, 84, 126, 126, 84, 36, 9, 1]] + expected = [ + [1], + [1, 1], + [1, 2, 1], + [1, 3, 3, 1], + [1, 4, 6, 4, 1], + [1, 5, 10, 10, 5, 1], + [1, 6, 15, 20, 15, 6, 1], + [1, 7, 21, 35, 35, 21, 7, 1], + [1, 8, 28, 56, 70, 56, 28, 8, 1], + [1, 9, 36, 84, 126, 126, 84, 36, 9, 1] + ] + expect(pascal.rows(10)).toEqual expected diff --git a/exercises/practice/relative-distance/relative-distance.spec.coffee b/exercises/practice/relative-distance/relative-distance.spec.coffee index 7d8d615d..f3cf65d1 100644 --- a/exercises/practice/relative-distance/relative-distance.spec.coffee +++ b/exercises/practice/relative-distance/relative-distance.spec.coffee @@ -148,7 +148,8 @@ describe 'RelativeDistance', -> results = RD.degreesOfSeparation familyTree, 'Lucia', 'Jun' expect(results).toEqual 14 - xit 'Complex graph, some shortcuts, cross-down and cross-up, cousins several times removed, with unrelated family tree', -> + xit 'Complex graph, some shortcuts, cross-down and cross-up, cousins several times removed, ' + + 'with unrelated family tree', -> familyTree = { 'Mina': ['Viktor', 'Wang'] 'Olga': ['Yuki'] diff --git a/exercises/practice/satellite/satellite.spec.coffee b/exercises/practice/satellite/satellite.spec.coffee index 4464ac90..205e3a7d 100644 --- a/exercises/practice/satellite/satellite.spec.coffee +++ b/exercises/practice/satellite/satellite.spec.coffee @@ -44,7 +44,9 @@ describe 'Satellite', -> xit 'Reject inconsistent traversals of same length', -> preorder = ['x', 'y', 'z'] inorder = ['a', 'b', 'c'] - expect(-> Satellite.treeFromTraversals(preorder, inorder)).toThrow new Error 'traversals must have the same elements' + expect(-> Satellite.treeFromTraversals(preorder, inorder)).toThrow new Error( + 'traversals must have the same elements' + ) xit 'Reject traversals with repeated items', -> preorder = ['a', 'b', 'a'] From a3e481711cbd401f93a71d15c5152d751501bc53 Mon Sep 17 00:00:00 2001 From: BNAndras <20251272+BNAndras@users.noreply.github.com> Date: Fri, 29 May 2026 20:13:04 -0700 Subject: [PATCH 8/8] Fix fat arrows --- .../practice/camicia/camicia.spec.coffee | 58 +++++++++---------- exercises/practice/change/change.spec.coffee | 28 ++++----- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/exercises/practice/camicia/camicia.spec.coffee b/exercises/practice/camicia/camicia.spec.coffee index 9fdab7ea..2c5e1ef8 100644 --- a/exercises/practice/camicia/camicia.spec.coffee +++ b/exercises/practice/camicia/camicia.spec.coffee @@ -1,61 +1,61 @@ Camicia = require './camicia' -describe 'Camicia', => - it 'two cards, one trick', => +describe 'Camicia', -> + it 'two cards, one trick', -> playerA = ['2'] playerB = ['3'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 2, tricks: 1} - xit 'three cards, one trick', => + xit 'three cards, one trick', -> playerA = ['2', '4'] playerB = ['3'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 3, tricks: 1} - xit 'four cards, one trick', => + xit 'four cards, one trick', -> playerA = ['2', '4'] playerB = ['3', '5', '6'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 4, tricks: 1} - xit 'the ace reigns supreme', => + xit 'the ace reigns supreme', -> playerA = ['2', 'A'] playerB = ['3', '4', '5', '6', '7'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7, tricks: 1} - xit 'the king beats ace', => + xit 'the king beats ace', -> playerA = ['2', 'A'] playerB = ['3', '4', '5', '6', 'K'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7, tricks: 1} - xit 'the queen seduces the king', => + xit 'the queen seduces the king', -> playerA = ['2', 'A', '7', '8', 'Q'] playerB = ['3', '4', '5', '6', 'K'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 10, tricks: 1} - xit 'the jack betrays the queen', => + xit 'the jack betrays the queen', -> playerA = ['2', 'A', '7', '8', 'Q'] playerB = ['3', '4', '5', '6', 'K', '9', 'J'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 12, tricks: 1} - xit 'the 10 just wants to put on a show', => + xit 'the 10 just wants to put on a show', -> playerA = ['2', 'A', '7', '8', 'Q', '10'] playerB = ['3', '4', '5', '6', 'K', '9', 'J'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 13, tricks: 1} - xit 'simple loop with decks of 3 cards', => + xit 'simple loop with decks of 3 cards', -> playerA = ['J', '2', '3'] playerB = ['4', 'J', '5'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'loop', cards: 8, tricks: 3} - xit 'the story is starting to get a bit complicated', => + xit 'the story is starting to get a bit complicated', -> playerA = [ '2', '6', '6', 'J', '4', 'K', 'Q', '10', 'K', 'J' 'Q', '2', '3', 'K', '5', '6', 'Q', 'Q', 'A', 'A' @@ -97,25 +97,25 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 361, tricks: 1} - xit 'two tricks', => + xit 'two tricks', -> playerA = ['J'] playerB = ['3', 'J'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 5, tricks: 2} - xit 'more tricks', => + xit 'more tricks', -> playerA = ['J', '2', '4'] playerB = ['3', 'J', 'A'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 12, tricks: 4} - xit 'simple loop with decks of 4 cards', => + xit 'simple loop with decks of 4 cards', -> playerA = ['2', '3', 'J', '6'] playerB = ['K', '5', 'J', '7'] results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'loop', cards: 16, tricks: 4} - xit 'easy card combination', => + xit 'easy card combination', -> playerA = [ '4', '8', '7', '5', '4', '10', '3', '9', '7', '3' '10', '10', '6', '8', '2', '8', '5', '4', '5', '9' @@ -129,7 +129,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 40, tricks: 4} - xit 'easy card combination, inverted decks', => + xit 'easy card combination, inverted decks', -> playerA = [ '3', '3', '5', '7', '3', '2', '10', '7', '6', '7' 'A', 'A', 'A', 'A', 'K', 'K', 'K', 'K', 'Q', 'Q' @@ -143,7 +143,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 40, tricks: 4} - xit 'mirrored decks', => + xit 'mirrored decks', -> playerA = [ '2', 'A', '3', 'A', '3', 'K', '4', 'K', '2', 'Q' '2', 'Q', '10', 'J', '5', 'J', '6', '10', '2', '9' @@ -157,7 +157,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 59, tricks: 4} - xit 'opposite decks', => + xit 'opposite decks', -> playerA = [ '4', 'A', '9', 'A', '4', 'K', '9', 'K', '6', 'Q' '8', 'Q', '8', 'J', '10', 'J', '9', '8', '4', '6' @@ -171,7 +171,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 151, tricks: 21} - xit 'random decks #1', => + xit 'random decks #1', -> playerA = [ 'K', '10', '9', '8', 'J', '8', '6', '9', '7', 'A' 'K', '5', '4', '4', 'J', '5', 'J', '4', '3', '5' @@ -185,7 +185,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 542, tricks: 76} - xit 'random decks #2', => + xit 'random decks #2', -> playerA = [ '8', 'A', '4', '8', '5', 'Q', 'J', '2', '6', '2' '9', '7', 'K', 'A', '8', '10', 'K', '8', '10', '9' @@ -199,7 +199,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 327, tricks: 42} - xit 'Kleber 1999', => + xit 'Kleber 1999', -> playerA = [ '4', '8', '9', 'J', 'Q', '8', '5', '5', 'K', '2' 'A', '9', '8', '5', '10', 'A', '4', 'J', '3', 'K' @@ -213,7 +213,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 5790, tricks: 805} - xit 'Collins 2006', => + xit 'Collins 2006', -> playerA = [ 'A', '8', 'Q', 'K', '9', '10', '3', '7', '4', '2' 'Q', '3', '2', '10', '9', 'K', 'A', '8', '7', '7' @@ -227,7 +227,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 6913, tricks: 960} - xit 'Mann and Wu 2007', => + xit 'Mann and Wu 2007', -> playerA = [ 'K', '2', 'K', 'K', '3', '3', '6', '10', 'K', '6' 'A', '2', '5', '5', '7', '9', 'J', 'A', 'A', '3' @@ -241,7 +241,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7157, tricks: 1007} - xit 'Nessler 2012', => + xit 'Nessler 2012', -> playerA = [ '10', '3', '6', '7', 'Q', '2', '9', '8', '2', '8' '4', 'A', '10', '6', 'K', '2', '10', 'A', '5', 'A' @@ -255,7 +255,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7207, tricks: 1015} - xit 'Anderson 2013', => + xit 'Anderson 2013', -> playerA = [ '6', '7', 'A', '3', 'Q', '3', '5', 'J', '3', '2' 'J', '7', '4', '5', 'Q', '10', '5', 'A', 'J', '2' @@ -269,7 +269,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7225, tricks: 1016} - xit 'Rucklidge 2014', => + xit 'Rucklidge 2014', -> playerA = [ '8', 'J', '2', '9', '4', '4', '5', '8', 'Q', '3' '9', '3', '6', '2', '8', 'A', 'A', 'A', '9', '4' @@ -283,7 +283,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7959, tricks: 1122} - xit 'Nessler 2021', => + xit 'Nessler 2021', -> playerA = [ '7', '2', '3', '4', 'K', '9', '6', '10', 'A', '8' '9', 'Q', '7', 'A', '4', '8', 'J', 'J', 'A', '4' @@ -297,7 +297,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 7972, tricks: 1106} - xit 'Nessler 2022', => + xit 'Nessler 2022', -> playerA = [ '2', '10', '10', 'A', 'J', '3', '8', 'Q', '2', '5' '5', '5', '9', '2', '4', '3', '10', 'Q', 'A', 'K' @@ -311,7 +311,7 @@ describe 'Camicia', => results = Camicia.simulateGame playerA, playerB expect(results).toEqual {status: 'finished', cards: 8344, tricks: 1164} - xit 'Casella 2024, first infinite game found', => + xit 'Casella 2024, first infinite game found', -> playerA = [ '2', '8', '4', 'K', '5', '2', '3', 'Q', '6', 'K' 'Q', 'A', 'J', '3', '5', '9', '8', '3', 'A', 'A' diff --git a/exercises/practice/change/change.spec.coffee b/exercises/practice/change/change.spec.coffee index 19de09ef..bb4139cc 100644 --- a/exercises/practice/change/change.spec.coffee +++ b/exercises/practice/change/change.spec.coffee @@ -1,59 +1,59 @@ Change = require './change' -describe 'Change', => - it 'change for 1 cent', => +describe 'Change', -> + it 'change for 1 cent', -> results = Change.findFewestCoins [1, 5, 10, 25], 1 expect(results).toEqual [1] - xit 'single coin change', => + xit 'single coin change', -> results = Change.findFewestCoins [1, 5, 10, 25, 100], 25 expect(results).toEqual [25] - xit 'multiple coin change', => + xit 'multiple coin change', -> results = Change.findFewestCoins [1, 5, 10, 25, 100], 15 expect(results).toEqual [5, 10] - xit 'change with Lilliputian Coins', => + xit 'change with Lilliputian Coins', -> results = Change.findFewestCoins [1, 4, 15, 20, 50], 23 expect(results).toEqual [4, 4, 15] - xit 'change with Lower Elbonia Coins', => + xit 'change with Lower Elbonia Coins', -> results = Change.findFewestCoins [1, 5, 10, 21, 25], 63 expect(results).toEqual [21, 21, 21] - xit 'large target values', => + xit 'large target values', -> results = Change.findFewestCoins [1, 2, 5, 10, 20, 50, 100], 999 expect(results).toEqual [ 2, 2, 5, 20, 20, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100, ] - xit 'possible change without unit coins available', => + xit 'possible change without unit coins available', -> results = Change.findFewestCoins [2, 5, 10, 20, 50], 21 expect(results).toEqual [2, 2, 2, 5, 10] - xit 'another possible change without unit coins available', => + xit 'another possible change without unit coins available', -> results = Change.findFewestCoins [4, 5], 27 expect(results).toEqual [4, 4, 4, 5, 5, 5] - xit 'a greedy approach is not optimal', => + xit 'a greedy approach is not optimal', -> results = Change.findFewestCoins [1, 10, 11], 20 expect(results).toEqual [10, 10] - xit 'no coins make 0 change', => + xit 'no coins make 0 change', -> results = Change.findFewestCoins [1, 5, 10, 21, 25], 0 expect(results).toEqual [] - xit 'error testing for change smaller than the smallest of coins', => + xit 'error testing for change smaller than the smallest of coins', -> expect -> Change.findFewestCoins [5, 10], 3 .toThrow new Error "can't make target with given coins" - xit 'error testing if no combination can add up to target', => + xit 'error testing if no combination can add up to target', -> expect -> Change.findFewestCoins [5, 10], 94 .toThrow new Error "can't make target with given coins" - xit 'cannot find negative change values', => + xit 'cannot find negative change values', -> expect -> Change.findFewestCoins [1, 2, 5], -5 .toThrow new Error "target can't be negative"