diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md index 77a4d5dfdd..ec0b668828 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/100-doors.english.md @@ -20,11 +20,11 @@ Implement a function to determine the state of the doors after the last pass. Re ```yml tests: - text: getFinalOpenedDoors is a function. - testString: assert(typeof getFinalOpenedDoors === 'function', 'getFinalOpenedDoors is a function.'); + testString: assert(typeof getFinalOpenedDoors === 'function'); - text: getFinalOpenedDoors should return an array. - testString: assert(Array.isArray(getFinalOpenedDoors(100)), 'getFinalOpenedDoors should return an array.'); + testString: assert(Array.isArray(getFinalOpenedDoors(100))); - text: getFinalOpenedDoors did not produce the correct results. - testString: assert.deepEqual(getFinalOpenedDoors(100), solution, 'getFinalOpenedDoors did not produce the correct results.'); + testString: assert.deepEqual(getFinalOpenedDoors(100), solution); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md index ec3f107b6d..e056132532 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/24-game.english.md @@ -36,15 +36,15 @@ Implement a function that takes a string of four digits as its argument, with ea ```yml tests: - text: solve24 is a function. - testString: assert(typeof solve24 === 'function', 'solve24 is a function.'); + testString: assert(typeof solve24 === 'function'); - text: solve24("4878") should return (7-8/8)*4 or 4*(7-8/8) - testString: assert(include(answers[0], solve24(testCases[0])), 'solve24("4878") should return (7-8/8)*4 or 4*(7-8/8)'); + testString: assert(include(answers[0], solve24(testCases[0]))); - text: solve24("1234") should return any arrangement of 1*2*3*4 - testString: assert(include(answers[1], solve24(testCases[1])), 'solve24("1234") should return any arrangement of 1*2*3*4'); + testString: assert(include(answers[1], solve24(testCases[1]))); - text: solve24("6789") should return (6*8)/(9-7) or (8*6)/(9-7) - testString: assert(include(answers[2], solve24(testCases[2])), 'solve24("6789") should return (6*8)/(9-7) or (8*6)/(9-7)'); + testString: assert(include(answers[2], solve24(testCases[2]))); - text: solve24("1127") should return a permutation of (1+7)*(1*2) - testString: assert(include(answers[3], solve24(testCases[3])), 'solve24("1127") should return a permutation of (1+7)*(1*2)'); + testString: assert(include(answers[3], solve24(testCases[3]))); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md index b8093d3783..9cb736123f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/9-billion-names-of-god-the-integer.english.md @@ -40,19 +40,19 @@ Implement a function that returns the sum of the $n$-th row. ```yml tests: - text: numberOfNames is a function. - testString: assert(typeof numberOfNames === 'function', 'numberOfNames is a function.'); + testString: assert(typeof numberOfNames === 'function'); - text: numberOfNames(5) should equal 7. - testString: assert.equal(numberOfNames(5), 7, 'numberOfNames(5) should equal 7.'); + testString: assert.equal(numberOfNames(5), 7); - text: numberOfNames(12) should equal 77. - testString: assert.equal(numberOfNames(12), 77, 'numberOfNames(12) should equal 77.'); + testString: assert.equal(numberOfNames(12), 77); - text: numberOfNames(18) should equal 385. - testString: assert.equal(numberOfNames(18), 385, 'numberOfNames(18) should equal 385.'); + testString: assert.equal(numberOfNames(18), 385); - text: numberOfNames(23) should equal 1255. - testString: assert.equal(numberOfNames(23), 1255, 'numberOfNames(23) should equal 1255.'); + testString: assert.equal(numberOfNames(23), 1255); - text: numberOfNames(42) should equal 53174. - testString: assert.equal(numberOfNames(42), 53174, 'numberOfNames(42) should equal 53174.'); + testString: assert.equal(numberOfNames(42), 53174); - text: numberOfNames(123) should equal 2552338241. - testString: assert.equal(numberOfNames(123), 2552338241, 'numberOfNames(123) should equal 2552338241.'); + testString: assert.equal(numberOfNames(123), 2552338241); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md index 1dfe0c2902..097f6cb588 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abc-problem.english.md @@ -47,21 +47,21 @@ Some rules to keep in mind: ```yml tests: - text: canMakeWord is a function. - testString: assert(typeof canMakeWord === 'function', 'canMakeWord is a function.'); + testString: assert(typeof canMakeWord === 'function'); - text: canMakeWord should return a boolean. - testString: assert(typeof canMakeWord('hi') === 'boolean', 'canMakeWord should return a boolean.'); + testString: assert(typeof canMakeWord('hi') === 'boolean'); - text: canMakeWord("bark") should return true. - testString: assert(canMakeWord(words[0]), 'canMakeWord("bark") should return true.'); + testString: assert(canMakeWord(words[0])); - text: canMakeWord("BooK") should return false. - testString: assert(!canMakeWord(words[1]), 'canMakeWord("BooK") should return false.'); + testString: assert(!canMakeWord(words[1])); - text: canMakeWord("TReAT") should return true. - testString: assert(canMakeWord(words[2]), 'canMakeWord("TReAT") should return true.'); + testString: assert(canMakeWord(words[2])); - text: canMakeWord("COMMON") should return false. - testString: assert(!canMakeWord(words[3]), 'canMakeWord("COMMON") should return false.'); + testString: assert(!canMakeWord(words[3])); - text: canMakeWord("squAD") should return true. - testString: assert(canMakeWord(words[4]), 'canMakeWord("squAD") should return true.'); + testString: assert(canMakeWord(words[4])); - text: canMakeWord("conFUSE") should return true. - testString: assert(canMakeWord(words[5]), 'canMakeWord("conFUSE") should return true.'); + testString: assert(canMakeWord(words[5])); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md index 62158c419e..3c47ff8501 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/abundant-deficient-and-perfect-number-classifications.english.md @@ -31,13 +31,13 @@ Implement a function that calculates how many of the integers from 1getDPA is a function. - testString: assert(typeof getDPA === 'function', 'getDPA is a function.'); + testString: assert(typeof getDPA === 'function'); - text: getDPA should return an array. - testString: assert(Array.isArray(getDPA(100)), 'getDPA should return an array.'); + testString: assert(Array.isArray(getDPA(100))); - text: getDPA return value should have a length of 3. - testString: assert(getDPA(100).length === 3, 'getDPA return value should have a length of 3.'); + testString: assert(getDPA(100).length === 3); - text: getDPA(20000) should equal [15043, 4, 4953] - testString: assert.deepEqual(getDPA(20000), solution, 'getDPA(20000) should equal [15043, 4, 4953]'); + testString: assert.deepEqual(getDPA(20000), solution); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md index d98e0f5c5c..fbc166dd02 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/accumulator-factory.english.md @@ -24,13 +24,13 @@ Closures save outer state. ```yml tests: - text: accumulator is a function. - testString: assert(typeof accumulator === 'function', 'accumulator is a function.'); + testString: assert(typeof accumulator === 'function'); - text: accumulator(0) should return a function. - testString: assert(typeof accumulator(0) === 'function', 'accumulator(0) should return a function.'); + testString: assert(typeof accumulator(0) === 'function'); - text: accumulator(0)(2) should return a number. - testString: assert(typeof accumulator(0)(2) === 'number', 'accumulator(0)(2) should return a number.'); + testString: assert(typeof accumulator(0)(2) === 'number'); - text: Passing in the values 3, -4, 1.5, and 5 should return 5.5. - testString: assert(testFn(5) === 5.5, 'Passing in the values 3, -4, 1.5, and 5 should return 5.5.'); + testString: assert(testFn(5) === 5.5); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md index 0e1b86497b..4d0a1a6637 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ackermann-function.english.md @@ -23,15 +23,15 @@ Write a function which returns the value of $A(m, n)$. Arbitrary precision is pr ```yml tests: - text: ack is a function. - testString: assert(typeof ack === 'function', 'ack is a function.'); + testString: assert(typeof ack === 'function'); - text: ack(0, 0) should return 1. - testString: assert(ack(0, 0) === 1, 'ack(0, 0) should return 1.'); + testString: assert(ack(0, 0) === 1); - text: ack(1, 1) should return 3. - testString: assert(ack(1, 1) === 3, 'ack(1, 1) should return 3.'); + testString: assert(ack(1, 1) === 3); - text: ack(2, 5) should return 13. - testString: assert(ack(2, 5) === 13, 'ack(2, 5) should return 13.'); + testString: assert(ack(2, 5) === 13); - text: ack(3, 3) should return 61. - testString: assert(ack(3, 3) === 61, 'ack(3, 3) should return 61.'); + testString: assert(ack(3, 3) === 61); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md index fe3e957a15..5ba697f9d9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/align-columns.english.md @@ -43,7 +43,7 @@ or$center$justified$within$its$column. ```yml tests: - text: formatText is a function. - testString: assert(typeof formatText === 'function', 'formatText is a function.'); + testString: assert(typeof formatText === 'function'); - text: 'formatText with the above input and "right" justification should produce the following: ' testString: 'assert.strictEqual(formatText(testInput, ''right''), rightAligned);' - text: 'formatText with the above input and "left" justification should produce the following: ' diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md index b54b1d4e58..f0d5da9f60 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/amicable-pairs.english.md @@ -26,13 +26,13 @@ Calculate and show here the Amicable pairs below 20,000 (there are eight). ```yml tests: - text: amicablePairsUpTo is a function. - testString: assert(typeof amicablePairsUpTo === 'function', 'amicablePairsUpTo is a function.'); + testString: assert(typeof amicablePairsUpTo === 'function'); - text: amicablePairsUpTo(300) should return [[220,284]]. - testString: assert.deepEqual(amicablePairsUpTo(300), answer300, 'amicablePairsUpTo(300) should return [[220,284]].'); + testString: assert.deepEqual(amicablePairsUpTo(300), answer300); - text: amicablePairsUpTo(3000) should return [[220,284],[1184,1210],[2620,2924]]. - testString: assert.deepEqual(amicablePairsUpTo(3000), answer3000, 'amicablePairsUpTo(3000) should return [[220,284],[1184,1210],[2620,2924]].'); + testString: assert.deepEqual(amicablePairsUpTo(3000), answer3000); - text: amicablePairsUpTo(20000) should return [[220,284],[1184,1210],[2620,2924],[5020,5564],[6232,6368],[10744,10856],[12285,14595],[17296,18416]]. - testString: assert.deepEqual(amicablePairsUpTo(20000), answer20000, 'amicablePairsUpTo(20000) should return [[220,284],[1184,1210],[2620,2924],[5020,5564],[6232,6368],[10744,10856],[12285,14595],[17296,18416]].'); + testString: assert.deepEqual(amicablePairsUpTo(20000), answer20000); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md index c68c451666..026dcfc2bb 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-mode.english.md @@ -22,11 +22,11 @@ If it is not appropriate or possible to support a general collection, use a vect ```yml tests: - text: mode is a function. - testString: assert(typeof mode === 'function', 'mode is a function.'); + testString: assert(typeof mode === 'function'); - text: mode([1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]) should equal [6] - testString: assert.deepEqual(mode(arr1), [6], 'mode([1, 3, 6, 6, 6, 6, 7, 7, 12, 12, 17]) should equal [6]'); + testString: assert.deepEqual(mode(arr1), [6]); - text: mode([1, 2, 4, 4, 1]) should equal [1, 4]. - testString: assert.deepEqual(mode(arr2).sort(), [1, 4], 'mode([1, 2, 4, 4, 1]) should equal [1, 4].'); + testString: assert.deepEqual(mode(arr2).sort(), [1, 4]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md index 9e62ffc2cc..3c7319aec2 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-pythagorean-means.english.md @@ -42,9 +42,9 @@ For the answer, please output an object in the following format: ```yml tests: - text: pythagoreanMeans is a function. - testString: assert(typeof pythagoreanMeans === 'function', 'pythagoreanMeans is a function.'); + testString: assert(typeof pythagoreanMeans === 'function'); - text: pythagoreanMeans([1, 2, ..., 10]) should equal the same output above. - testString: assert.deepEqual(pythagoreanMeans(range1), answer1, 'pythagoreanMeans([1, 2, ..., 10]) should equal the same output above.'); + testString: assert.deepEqual(pythagoreanMeans(range1), answer1); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md index 0b5371451b..1b9174d530 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/averages-root-mean-square.english.md @@ -23,9 +23,9 @@ The RMS is calculated as the mean of the squares of the numbers, square-rooted: ```yml tests: - text: rms is a function. - testString: assert(typeof rms === 'function', 'rms is a function.'); + testString: assert(typeof rms === 'function'); - text: rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) should equal 6.2048368229954285. - testString: assert.equal(rms(arr1), answer1, 'rms([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) should equal 6.2048368229954285.'); + testString: assert.equal(rms(arr1), answer1); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md index 82e18711f2..72e5021c10 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/babbage-problem.english.md @@ -26,9 +26,9 @@ Implement a function to return the lowest integer that satisfies the Babbage pro ```yml tests: - text: babbage is a function. - testString: assert(typeof babbage === 'function', 'babbage is a function.'); + testString: assert(typeof babbage === 'function'); - text: babbage(99736, 269696) should not return 99736 (there is a smaller answer). - testString: assert.equal(babbage(babbageAns, endDigits), answer, 'babbage(99736, 269696) should not return 99736 (there is a smaller answer).'); + testString: assert.equal(babbage(babbageAns, endDigits), answer); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md index 4d442f1b44..da06e9efe7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/balanced-brackets.english.md @@ -30,43 +30,43 @@ Determine whether a generated string of brackets is balanced; that is, whether i ```yml tests: - text: isBalanced is a function. - testString: assert(typeof isBalanced === 'function', 'isBalanced is a function.'); + testString: assert(typeof isBalanced === 'function'); - text: isBalanced("[]") should return true. - testString: assert(isBalanced(testCases[0]), 'isBalanced("[]") should return true.'); + testString: assert(isBalanced(testCases[0])); - text: isBalanced("]][[[][][][]][") should return false. - testString: assert(!isBalanced(testCases[1]), 'isBalanced("]][[[][][][]][") should return false.'); + testString: assert(!isBalanced(testCases[1])); - text: isBalanced("[][[[[][][[[]]]]]]") should return true. - testString: assert(isBalanced(testCases[2]), 'isBalanced("[][[[[][][[[]]]]]]") should return true.'); + testString: assert(isBalanced(testCases[2])); - text: isBalanced("][") should return true. - testString: assert(!isBalanced(testCases[3]), 'isBalanced("][") should return true.'); + testString: assert(!isBalanced(testCases[3])); - text: isBalanced("[[[]]]][[]") should return true. - testString: assert(!isBalanced(testCases[4]), 'isBalanced("[[[]]]][[]") should return true.'); + testString: assert(!isBalanced(testCases[4])); - text: isBalanced("][[]") should return true. - testString: assert(!isBalanced(testCases[5]), 'isBalanced("][[]") should return true.'); + testString: assert(!isBalanced(testCases[5])); - text: isBalanced("][[][]][[[]]") should return true. - testString: assert(!isBalanced(testCases[6]), 'isBalanced("][[][]][[[]]") should return true.'); + testString: assert(!isBalanced(testCases[6])); - text: isBalanced("[[][]]][") should return true. - testString: assert(!isBalanced(testCases[7]), 'isBalanced("[[][]]][") should return true.'); + testString: assert(!isBalanced(testCases[7])); - text: isBalanced("[[[]]][[]]]][][[") should return true. - testString: assert(!isBalanced(testCases[8]), 'isBalanced("[[[]]][[]]]][][[") should return true.'); + testString: assert(!isBalanced(testCases[8])); - text: isBalanced("[]][[]]][[[[][]]") should return true. - testString: assert(!isBalanced(testCases[9]), 'isBalanced("[]][[]]][[[[][]]") should return true.'); + testString: assert(!isBalanced(testCases[9])); - text: isBalanced("][]][[][") should return true. - testString: assert(!isBalanced(testCases[10]), 'isBalanced("][]][[][") should return true.'); + testString: assert(!isBalanced(testCases[10])); - text: isBalanced("[[]][[][]]") should return true. - testString: assert(isBalanced(testCases[11]), 'isBalanced("[[]][[][]]") should return true.'); + testString: assert(isBalanced(testCases[11])); - text: isBalanced("[[]]") should return true. - testString: assert(isBalanced(testCases[12]), 'isBalanced("[[]]") should return true.'); + testString: assert(isBalanced(testCases[12])); - text: isBalanced("]][]][[]][[[") should return true. - testString: assert(!isBalanced(testCases[13]), 'isBalanced("]][]][[]][[[") should return true.'); + testString: assert(!isBalanced(testCases[13])); - text: isBalanced("][]][][[") should return true. - testString: assert(!isBalanced(testCases[14]), 'isBalanced("][]][][[") should return true.'); + testString: assert(!isBalanced(testCases[14])); - text: isBalanced("][][") should return true. - testString: assert(!isBalanced(testCases[15]), 'isBalanced("][][") should return true.'); + testString: assert(!isBalanced(testCases[15])); - text: isBalanced("[[]]][][][[]][") should return true. - testString: assert(!isBalanced(testCases[16]), 'isBalanced("[[]]][][][[]][") should return true.'); + testString: assert(!isBalanced(testCases[16])); - text: isBalanced("") should return true. - testString: assert(isBalanced(testCases[17]), 'isBalanced("") should return true.'); + testString: assert(isBalanced(testCases[17])); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md index 6c8d0b2d92..9021dc9166 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/circles-of-given-radius-through-two-points.english.md @@ -42,17 +42,17 @@ Implement a function that takes two points and a radius and returns the two circ ```yml tests: - text: getCircles is a function. - testString: assert(typeof getCircles === 'function', 'getCircles is a function.'); + testString: assert(typeof getCircles === 'function'); - text: getCircles([0.1234, 0.9876], [0.8765, 0.2345], 2.0) should return [[1.8631, 1.9742], [-0.8632, -0.7521]]. - testString: assert.deepEqual(getCircles(...testCases[0]), answers[0], 'getCircles([0.1234, 0.9876], [0.8765, 0.2345], 2.0) should return [[1.8631, 1.9742], [-0.8632, -0.7521]].'); + testString: assert.deepEqual(getCircles(...testCases[0]), answers[0]); - text: getCircles([0.0000, 2.0000], [0.0000, 0.0000], 1.0) should return [0, 1] - testString: assert.deepEqual(getCircles(...testCases[1]), answers[1], 'getCircles([0.0000, 2.0000], [0.0000, 0.0000], 1.0) should return [0, 1]'); + testString: assert.deepEqual(getCircles(...testCases[1]), answers[1]); - text: getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0) should return Coincident point. Infinite solutions - testString: assert.deepEqual(getCircles(...testCases[2]), answers[2], 'getCircles([0.1234, 0.9876], [0.1234, 0.9876], 2.0) should return Coincident point. Infinite solutions'); + testString: assert.deepEqual(getCircles(...testCases[2]), answers[2]); - text: getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5) should return No intersection. Points further apart than circle diameter - testString: assert.deepEqual(getCircles(...testCases[3]), answers[3], 'getCircles([0.1234, 0.9876], [0.8765, 0.2345], 0.5) should return No intersection. Points further apart than circle diameter'); + testString: assert.deepEqual(getCircles(...testCases[3]), answers[3]); - text: getCircles([0.1234, 0.9876], [0.1234, 0.9876], 0.0) should return Radius Zero - testString: assert.deepEqual(getCircles(...testCases[4]), answers[4], 'getCircles([0.1234, 0.9876], [0.1234, 0.9876], 0.0) should return Radius Zero'); + testString: assert.deepEqual(getCircles(...testCases[4]), answers[4]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md index 28803bd2be..f42ad9d801 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/closest-pair-problem.english.md @@ -81,15 +81,15 @@ For the input, expect the argument to be an array of objects (points) with getClosestPair is a function. - testString: assert(typeof getClosestPair === 'function', 'getClosestPair is a function.'); + testString: assert(typeof getClosestPair === 'function'); - text: Distance should be the following. - testString: assert.equal(getClosestPair(points1).distance, answer1.distance, 'Distance should be the following.'); + testString: assert.equal(getClosestPair(points1).distance, answer1.distance); - text: Points should be the following. - testString: assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points1))).pair, answer1.pair, 'Points should be the following.'); + testString: assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points1))).pair, answer1.pair); - text: Distance should be the following. - testString: assert.equal(getClosestPair(points2).distance, answer2.distance, 'Distance should be the following.'); + testString: assert.equal(getClosestPair(points2).distance, answer2.distance); - text: Points should be the following. - testString: assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points2))).pair, answer2.pair, 'Points should be the following.'); + testString: assert.deepEqual(JSON.parse(JSON.stringify(getClosestPair(points2))).pair, answer2.pair); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md index a611628b1b..9d8fcb6bae 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/combinations.english.md @@ -34,11 +34,11 @@ Given non-negative integers m and n, generate all size ```yml tests: - text: combinations is a function. - testString: assert(typeof combinations === 'function', 'combinations is a function.'); + testString: assert(typeof combinations === 'function'); - text: combinations(3, 5) should return [[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]. - testString: assert.deepEqual(combinations(testInput1[0], testInput1[1]), testOutput1, 'combinations(3, 5) should return [[0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 3], [0, 2, 4], [0, 3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]].'); + testString: assert.deepEqual(combinations(testInput1[0], testInput1[1]), testOutput1); - text: combinations(4, 6) should return [[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]] - testString: assert.deepEqual(combinations(testInput2[0], testInput2[1]), testOutput2, 'combinations(4, 6) should return [[0,1,2,3], [0,1,2,4], [0,1,2,5], [0,1,3,4], [0,1,3,5], [0,1,4,5], [0,2,3,4], [0,2,3,5], [0,2,4,5], [0,3,4,5], [1,2,3,4], [1,2,3,5], [1,2,4,5], [1,3,4,5], [2,3,4,5]]'); + testString: assert.deepEqual(combinations(testInput2[0], testInput2[1]), testOutput2); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md index 33f78c04b5..83f1a8e14d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/comma-quibbling.english.md @@ -34,17 +34,17 @@ Test your function with the following series of inputs showing your output here ```yml tests: - text: quibble is a function. - testString: assert(typeof quibble === 'function', 'quibble is a function.'); + testString: assert(typeof quibble === 'function'); - text: quibble(["ABC"]) should return a string. - testString: assert(typeof quibble(["ABC"]) === 'string', 'quibble(["ABC"]) should return a string.'); + testString: assert(typeof quibble(["ABC"]) === 'string'); - text: quibble([]) should return "{}". - testString: assert.equal(quibble(testCases[0]), results[0], 'quibble([]) should return "{}".'); + testString: assert.equal(quibble(testCases[0]), results[0]); - text: quibble(["ABC"]) should return "{ABC}". - testString: assert.equal(quibble(testCases[1]), results[1], 'quibble(["ABC"]) should return "{ABC}".'); + testString: assert.equal(quibble(testCases[1]), results[1]); - text: quibble(["ABC", "DEF"]) should return "{ABC and DEF}". - testString: assert.equal(quibble(testCases[2]), results[2], 'quibble(["ABC", "DEF"]) should return "{ABC and DEF}".'); + testString: assert.equal(quibble(testCases[2]), results[2]); - text: quibble(["ABC", "DEF", "G", "H"]) should return "{ABC,DEF,G and H}". - testString: assert.equal(quibble(testCases[3]), results[3], 'quibble(["ABC", "DEF", "G", "H"]) should return "{ABC,DEF,G and H}".'); + testString: assert.equal(quibble(testCases[3]), results[3]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md index 9beb48d504..2a6a232e6f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/compare-a-list-of-strings.english.md @@ -24,29 +24,29 @@ Given a allEqual is a function. - testString: assert(typeof allEqual === 'function', 'allEqual is a function.'); + testString: assert(typeof allEqual === 'function'); - text: azSorted is a function. - testString: assert(typeof azSorted === 'function', 'azSorted is a function.'); + testString: assert(typeof azSorted === 'function'); - text: allEqual(["AA", "AA", "AA", "AA"]) returns true. - testString: assert(allEqual(testCases[0]), 'allEqual(["AA", "AA", "AA", "AA"]) returns true.'); + testString: assert(allEqual(testCases[0])); - text: azSorted(["AA", "AA", "AA", "AA"]) returns false. - testString: assert(!azSorted(testCases[0]), 'azSorted(["AA", "AA", "AA", "AA"]) returns false.'); + testString: assert(!azSorted(testCases[0])); - text: allEqual(["AA", "ACB", "BB", "CC"]) returns false. - testString: assert(!allEqual(testCases[1]), 'allEqual(["AA", "ACB", "BB", "CC"]) returns false.'); + testString: assert(!allEqual(testCases[1])); - text: azSorted(["AA", "ACB", "BB", "CC"]) returns true. - testString: assert(azSorted(testCases[1]), 'azSorted(["AA", "ACB", "BB", "CC"]) returns true.'); + testString: assert(azSorted(testCases[1])); - text: allEqual([]) returns true. - testString: assert(allEqual(testCases[2]), 'allEqual([]) returns true.'); + testString: assert(allEqual(testCases[2])); - text: azSorted([]) returns true. - testString: assert(azSorted(testCases[2]), 'azSorted([]) returns true.'); + testString: assert(azSorted(testCases[2])); - text: allEqual(["AA"]) returns true. - testString: assert(allEqual(testCases[3]), 'allEqual(["AA"]) returns true.'); + testString: assert(allEqual(testCases[3])); - text: azSorted(["AA"]) returns true. - testString: assert(azSorted(testCases[3]), 'azSorted(["AA"]) returns true.'); + testString: assert(azSorted(testCases[3])); - text: allEqual(["BB", "AA"]) returns false. - testString: assert(!allEqual(testCases[4]), 'allEqual(["BB", "AA"]) returns false.'); + testString: assert(!allEqual(testCases[4])); - text: azSorted(["BB", "AA"]) returns false. - testString: assert(!azSorted(testCases[4]), 'azSorted(["BB", "AA"]) returns false.'); + testString: assert(!azSorted(testCases[4])); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md index 416d040e6b..6f2b9066f8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/convert-seconds-to-compound-duration.english.md @@ -55,13 +55,13 @@ Demonstrate that it passes the following three test-cases: ```yml tests: - text: convertSeconds is a function. - testString: assert(typeof convertSeconds === 'function', 'convertSeconds is a function.'); + testString: assert(typeof convertSeconds === 'function'); - text: convertSeconds(7259) should return 2 hr, 59 sec. - testString: assert.equal(convertSeconds(testCases[0]), results[0], 'convertSeconds(7259) should return 2 hr, 59 sec.'); + testString: assert.equal(convertSeconds(testCases[0]), results[0]); - text: convertSeconds(86400) should return 1 d. - testString: assert.equal(convertSeconds(testCases[1]), results[1], 'convertSeconds(86400) should return 1 d.'); + testString: assert.equal(convertSeconds(testCases[1]), results[1]); - text: convertSeconds(6000000) should return 9 wk, 6 d, 10 hr, 40 min. - testString: assert.equal(convertSeconds(testCases[2]), results[2], 'convertSeconds(6000000) should return 9 wk, 6 d, 10 hr, 40 min.'); + testString: assert.equal(convertSeconds(testCases[2]), results[2]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md index 73ff00fa4d..c61269d6f7 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-occurrences-of-a-substring.english.md @@ -28,13 +28,13 @@ In general, this essentially means matching from left-to-right or right-to-left. ```yml tests: - text: countSubstring is a function. - testString: assert(typeof countSubstring === 'function', 'countSubstring is a function.'); + testString: assert(typeof countSubstring === 'function'); - text: countSubstring("the three truths", "th") should return 3. - testString: assert.equal(countSubstring(testCases[0], searchString[0]), results[0], 'countSubstring("the three truths", "th") should return 3.'); + testString: assert.equal(countSubstring(testCases[0], searchString[0]), results[0]); - text: countSubstring("ababababab", "abab") should return 2. - testString: assert.equal(countSubstring(testCases[1], searchString[1]), results[1], 'countSubstring("ababababab", "abab") should return 2.'); + testString: assert.equal(countSubstring(testCases[1], searchString[1]), results[1]); - text: countSubstring("abaabba*bbaba*bbab", "a*b") should return 2. - testString: assert.equal(countSubstring(testCases[2], searchString[2]), results[2], 'countSubstring("abaabba*bbaba*bbab", "a*b") should return 2.'); + testString: assert.equal(countSubstring(testCases[2], searchString[2]), results[2]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md index e7d474112b..742503ad0e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/count-the-coins.english.md @@ -35,9 +35,9 @@ Implement a function to determine how many ways there are to make change for a d ```yml tests: - text: countCoins is a function. - testString: assert(typeof countCoins === 'function', 'countCoins is a function.'); + testString: assert(typeof countCoins === 'function'); - text: countCoints() should return 242. - testString: assert.equal(countCoins(), 242, 'countCoints() should return 242.'); + testString: assert.equal(countCoins(), 242); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md index f7d159def0..7cc570ea2d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/cramers-rule.english.md @@ -41,11 +41,11 @@ solve for $w$, $x$, $y$ and $z$, using Cramer's rule. ```yml tests: - text: cramersRule is a function. - testString: assert(typeof cramersRule === 'function', 'cramersRule is a function.'); + testString: assert(typeof cramersRule === 'function'); - text: cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49]) should return [2, -12, -4, 1]. - testString: assert.deepEqual(cramersRule(matrices[0], freeTerms[0]), answers[0], 'cramersRule([[2, -1, 5, 1], [3, 2, 2, -6], [1, 3, 3, -1], [5, -2, -3, 3]], [-3, -32, -47, 49]) should return [2, -12, -4, 1].'); + testString: assert.deepEqual(cramersRule(matrices[0], freeTerms[0]), answers[0]); - text: cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2]) should return [1, 1, -1]. - testString: assert.deepEqual(cramersRule(matrices[1], freeTerms[1]), answers[1], 'cramersRule([[3, 1, 1], [2, 2, 5], [1, -3, -4]], [3, -1, 2]) should return [1, 1, -1].'); + testString: assert.deepEqual(cramersRule(matrices[1], freeTerms[1]), answers[1]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md index 3e6be9f116..0ec1cb9bb1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-format.english.md @@ -25,11 +25,11 @@ Example output: ['2007-11-23', 'Sunday, November 23, 2007'] ```yml tests: - text: getDateFormats is a function. - testString: assert(typeof getDateFormats === 'function', 'getDateFormats is a function.'); + testString: assert(typeof getDateFormats === 'function'); - text: Should return an object. - testString: assert(typeof getDateFormats() === 'object', 'Should return an object.'); + testString: assert(typeof getDateFormats() === 'object'); - text: Should returned an array with 2 elements. - testString: assert(getDateFormats().length === 2, 'Should returned an array with 2 elements.'); + testString: assert(getDateFormats().length === 2); - text: Should return the correct date in the right format testString: assert.deepEqual(getDateFormats(), dates, equalsMessage); diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md index f0bda9fc97..fa311ceb33 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/date-manipulation.english.md @@ -22,19 +22,19 @@ Example output: "March 8 2009 7:30am EST" ```yml tests: - text: add12Hours is a function. - testString: assert(typeof add12Hours === 'function', 'add12Hours is a function.'); + testString: assert(typeof add12Hours === 'function'); - text: add12Hours(dateString) should return a string. - testString: assert(typeof add12Hours('January 17 2017 11:43am EST') === 'string', 'add12Hours(dateString) should return a string.'); + testString: assert(typeof add12Hours('January 17 2017 11:43am EST') === 'string'); - text: add12Hours("January 17 2017 11:43am EST") should return "January 17 2017 11:43pm EST" - testString: assert(add12Hours('January 17 2017 11:43am EST') === 'January 17 2017 11:43pm EST', 'add12Hours("January 17 2017 11:43am EST") should return "January 17 2017 11:43pm EST"'); + testString: assert(add12Hours('January 17 2017 11:43am EST') === 'January 17 2017 11:43pm EST'); - text: Should handel day change. add12Hours("March 7 2009 7:30pm EST") should return "March 8 2009 7:30am EST" - testString: assert(add12Hours('March 7 2009 7:30pm EST') === 'March 8 2009 7:30am EST', 'Should handel day change. add12Hours("March 7 2009 7:30pm EST") should return "March 8 2009 7:30am EST"'); + testString: assert(add12Hours('March 7 2009 7:30pm EST') === 'March 8 2009 7:30am EST'); - text: Should handel month change in a leap years. add12Hours("February 29 2004 9:15pm EST") should return "March 1 2004 9:15am EST" - testString: assert(add12Hours('February 29 2004 9:15pm EST') === 'March 1 2004 9:15am EST', 'Should handel month change in a leap years. add12Hours("February 29 2004 9:15pm EST") should return "March 1 2004 9:15am EST"'); + testString: assert(add12Hours('February 29 2004 9:15pm EST') === 'March 1 2004 9:15am EST'); - text: Should handel month change in a common years. add12Hours("February 28 1999 3:15pm EST") should return "March 1 1999 3:15am EST" - testString: assert(add12Hours('February 28 1999 3:15pm EST') === 'March 1 1999 3:15am EST', 'Should handel month change in a common years. add12Hours("February 28 1999 3:15pm EST") should return "March 1 1999 3:15am EST"'); + testString: assert(add12Hours('February 28 1999 3:15pm EST') === 'March 1 1999 3:15am EST'); - text: Should handel year change. add12Hours("December 31 2020 1:45pm EST") should return "January 1 2021 1:45am EST" - testString: assert(add12Hours('December 31 2020 1:45pm EST') === 'January 1 2021 1:45am EST', 'Should handel year change. add12Hours("December 31 2020 1:45pm EST") should return "January 1 2021 1:45am EST"'); + testString: assert(add12Hours('December 31 2020 1:45pm EST') === 'January 1 2021 1:45am EST'); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md index 966aba6d94..b8c9339d57 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/day-of-the-week.english.md @@ -20,13 +20,13 @@ Write a function that takes a start year and an end year and return an array of ```yml tests: - text: findXmasSunday is a function. - testString: assert(typeof findXmasSunday === 'function', 'findXmasSunday is a function.'); + testString: assert(typeof findXmasSunday === 'function'); - text: findChristmasSunday(2000, 2100) should return an array. - testString: assert(typeof findXmasSunday(2000, 2100) === 'object', 'findChristmasSunday(2000, 2100) should return an array.'); + testString: assert(typeof findXmasSunday(2000, 2100) === 'object'); - text: findChristmasSunday(2008, 2121 should return [1977, 1983, 1988, 1994, 2005, 2011, 2016] - testString: assert.deepEqual(findXmasSunday(1970, 2017), firstSolution, 'findChristmasSunday(2008, 2121 should return [1977, 1983, 1988, 1994, 2005, 2011, 2016]'); + testString: assert.deepEqual(findXmasSunday(1970, 2017), firstSolution); - text: findChristmasSunday(2008, 2121 should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118] - testString: assert.deepEqual(findXmasSunday(2008, 2121), secondSolution, 'findChristmasSunday(2008, 2121 should return [2011, 2016, 2022, 2033, 2039, 2044, 2050, 2061, 2067, 2072, 2078, 2089, 2095, 2101, 2107, 2112, 2118]'); + testString: assert.deepEqual(findXmasSunday(2008, 2121), secondSolution); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md index d46c309c21..e4a1f9ee81 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deal-cards-for-freecell.english.md @@ -78,11 +78,11 @@ Deals can also be checked against dealFreeCell is a function. - testString: assert(typeof dealFreeCell === 'function', 'dealFreeCell is a function.'); + testString: assert(typeof dealFreeCell === 'function'); - text: dealFreeCell(seed) should return an object. - testString: assert(typeof dealFreeCell(1) === 'object', 'dealFreeCell(seed) should return an object.'); + testString: assert(typeof dealFreeCell(1) === 'object'); - text: dealFreeCell(seed) should return an array of length 7. - testString: assert(dealFreeCell(1).length === 7, 'dealFreeCell(seed) should return an array of length 7.'); + testString: assert(dealFreeCell(1).length === 7); - text: "dealFreeCell(1) should return an array identical to example \"Game #1\"" testString: "assert.deepEqual(dealFreeCell(1), game1);" - text: "dealFreeCell(617) should return an array identical to example \"Game #617\"" diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md index 49cf3ec221..c7fd6f957a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/deepcopy.english.md @@ -27,15 +27,15 @@ This task will not test for: ```yml tests: - text: deepcopy should be a function. - testString: assert(typeof deepcopy === 'function', 'deepcopy should be a function.'); + testString: assert(typeof deepcopy === 'function'); - text: 'deepcopy({test: "test"}) should return an object.' testString: 'assert(typeof deepcopy(obj1) === ''object'');' - text: Should not return the same object that was provided. - testString: assert(deepcopy(obj2) != obj2, 'Should not return the same object that was provided.'); + testString: assert(deepcopy(obj2) != obj2); - text: When passed an object containing an array, should return a deep copy of the object. - testString: assert.deepEqual(deepcopy(obj2), obj2, 'When passed an object containing an array, should return a deep copy of the object.'); + testString: assert.deepEqual(deepcopy(obj2), obj2); - text: When passed an object containing another object, should return a deep copy of the object. - testString: assert.deepEqual(deepcopy(obj3), obj3, 'When passed an object containing another object, should return a deep copy of the object.'); + testString: assert.deepEqual(deepcopy(obj3), obj3); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md index b053e2335e..2638d7161c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/define-a-primitive-data-type.english.md @@ -29,15 +29,15 @@ tests: - text: new Num(4) should return an object. testString: assert(typeof (new Num(4)) === 'object'); - text: new Num('test') should throw a TypeError with message 'Not a Number'. - testString: assert.throws(() => new Num('test'), TypeError, 'Not a Number'); + testString: assert.throws(() => new Num('test'), TypeError); - text: new Num(0) should throw a TypeError with message 'Out of range'. - testString: assert.throws(() => new Num(0), TypeError, 'Out of range'); + testString: assert.throws(() => new Num(0), TypeError); - text: new Num(-5) should throw a TypeError with message 'Out of range'. - testString: assert.throws(() => new Num(-5), TypeError, 'Out of range'); + testString: assert.throws(() => new Num(-5), TypeError); - text: new Num(10) should throw a TypeError with message 'Out of range'. - testString: assert.throws(() => new Num(11), TypeError, 'Out of range'); + testString: assert.throws(() => new Num(11), TypeError); - text: new Num(20) should throw a TypeError with message 'Out of range'. - testString: assert.throws(() => new Num(20), TypeError, 'Out of range'); + testString: assert.throws(() => new Num(20), TypeError); - text: new Num(3) + new Num(4) should equal 7. testString: assert.equal(new Num(3) + new Num(4), 7); - text: new Num(3) - new Num(4) should equal -1. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md index dd3e3fec30..f79baeee5a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/department-numbers.english.md @@ -37,13 +37,13 @@ Write a program which outputs all valid combinations as an array. ```yml tests: - text: combinations should be a function. - testString: assert(typeof combinations === 'function', 'combinations should be a function.'); + testString: assert(typeof combinations === 'function'); - text: combinations([1, 2, 3], 6) should return an Array. - testString: assert(Array.isArray(combinations([1, 2, 3], 6)), 'combinations([1, 2, 3], 6) should return an Array.'); + testString: assert(Array.isArray(combinations([1, 2, 3], 6))); - text: combinations([1, 2, 3, 4, 5, 6, 7], 12) should return an array of length 14. - testString: assert(combinations(nums, total).length === len, 'combinations([1, 2, 3, 4, 5, 6, 7], 12) should return an array of length 14.'); + testString: assert(combinations(nums, total).length === len); - text: combinations([1, 2, 3, 4, 5, 6, 7], 12) should return all valid combinations. - testString: assert.deepEqual(combinations(nums, total), result, 'combinations([1, 2, 3, 4, 5, 6, 7], 12) should return all valid combinations.'); + testString: assert.deepEqual(combinations(nums, total), result); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md index a9fe6d260c..043f738c51 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/discordian-date.english.md @@ -20,21 +20,21 @@ Convert a given date from the . - testString: assert(discordianDate(new Date(2010, 6, 22)) === 'Pungenday, the 57th day of Confusion in the YOLD 3176', 'discordianDate(new Date(2010, 6, 22)) should return "Pungenday, the 57th day of Confusion in the YOLD 3176".'); + testString: assert(discordianDate(new Date(2010, 6, 22)) === 'Pungenday, the 57th day of Confusion in the YOLD 3176'); - text: discordianDate(new Date(2012, 1, 28)) should return "Prickle-Prickle, the 59th day of Chaos in the YOLD 3178". - testString: assert(discordianDate(new Date(2012, 1, 28)) === 'Prickle-Prickle, the 59th day of Chaos in the YOLD 3178', 'discordianDate(new Date(2012, 1, 28)) should return "Prickle-Prickle, the 59th day of Chaos in the YOLD 3178".'); + testString: assert(discordianDate(new Date(2012, 1, 28)) === 'Prickle-Prickle, the 59th day of Chaos in the YOLD 3178'); - text: discordianDate(new Date(2012, 1, 29)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!". - testString: assert(discordianDate(new Date(2012, 1, 29)) === 'Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!', 'discordianDate(new Date(2012, 1, 29)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!".'); + testString: assert(discordianDate(new Date(2012, 1, 29)) === 'Setting Orange, the 60th day of Chaos in the YOLD 3178. Celebrate St. Tib\'s Day!'); - text: discordianDate(new Date(2012, 2, 1)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178". - testString: assert(discordianDate(new Date(2012, 2, 1)) === 'Setting Orange, the 60th day of Chaos in the YOLD 3178', 'discordianDate(new Date(2012, 2, 1)) should return "Setting Orange, the 60th day of Chaos in the YOLD 3178".'); + testString: assert(discordianDate(new Date(2012, 2, 1)) === 'Setting Orange, the 60th day of Chaos in the YOLD 3178'); - text: discordianDate(new Date(2010, 0, 5)) should return "Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!". - testString: assert(discordianDate(new Date(2010, 0, 5)) === 'Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!', 'discordianDate(new Date(2010, 0, 5)) should return "Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!".'); + testString: assert(discordianDate(new Date(2010, 0, 5)) === 'Setting Orange, the 5th day of Chaos in the YOLD 3176. Celebrate Mungday!'); - text: discordianDate(new Date(2011, 4, 3)) should return "Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!". - testString: assert(discordianDate(new Date(2011, 4, 3)) === 'Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!', 'discordianDate(new Date(2011, 4, 3)) should return "Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!".'); + testString: assert(discordianDate(new Date(2011, 4, 3)) === 'Pungenday, the 50th day of Discord in the YOLD 3177. Celebrate Discoflux!'); - text: discordianDate(new Date(2015, 9, 19)) should return "Boomtime, the 73rd day of Bureaucracy in the YOLD 3181". - testString: assert(discordianDate(new Date(2015, 9, 19)) === 'Boomtime, the 73rd day of Bureaucracy in the YOLD 3181', 'discordianDate(new Date(2015, 9, 19)) should return "Boomtime, the 73rd day of Bureaucracy in the YOLD 3181".'); + testString: assert(discordianDate(new Date(2015, 9, 19)) === 'Boomtime, the 73rd day of Bureaucracy in the YOLD 3181'); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md index b23dc9943f..01cb2d50e6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/element-wise-operations.english.md @@ -29,21 +29,21 @@ The first parameter will be the operation to be performed, for example, "m_add" ```yml tests: - text: operation is a function. - testString: assert(typeof operation === 'function', 'operation is a function.'); + testString: assert(typeof operation === 'function'); - text: operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[2,4],[6,8]]. - testString: assert.deepEqual(operation('m_add', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[2, 4], [6, 8]], 'operation("m_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[2,4],[6,8]].'); + testString: assert.deepEqual(operation('m_add', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[2, 4], [6, 8]]); - text: operation("s_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[3,4],[5,6]]. - testString: assert.deepEqual(operation('s_add', [[1, 2], [3, 4]], 2), [[3, 4], [5, 6]], 'operation("s_add",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[3,4],[5,6]].'); + testString: assert.deepEqual(operation('s_add', [[1, 2], [3, 4]], 2), [[3, 4], [5, 6]]); - text: operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[0,0],[0,0]]. - testString: assert.deepEqual(operation('m_sub', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[0, 0], [0, 0]], 'operation("m_sub",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[0,0],[0,0]].'); + testString: assert.deepEqual(operation('m_sub', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[0, 0], [0, 0]]); - text: operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[9,16]]. - testString: assert.deepEqual(operation('m_mult', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [9, 16]], 'operation("m_mult",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[9,16]].'); + testString: assert.deepEqual(operation('m_mult', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [9, 16]]); - text: operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,1],[1,1]]. - testString: assert.deepEqual(operation('m_div', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 1], [1, 1]], 'operation("m_div",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,1],[1,1]].'); + testString: assert.deepEqual(operation('m_div', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 1], [1, 1]]); - text: operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[27,256]]. - testString: assert.deepEqual(operation('m_exp', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [27, 256]], 'operation("m_exp",[[1,2],[3,4]],[[1,2],[3,4]]) should return [[1,4],[27,256]].'); + testString: assert.deepEqual(operation('m_exp', [[1, 2], [3, 4]], [[1, 2], [3, 4]]), [[1, 4], [27, 256]]); - text: operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]]) should return [[10,12,14,16],[18,20,22,24]]. - testString: assert.deepEqual(operation('m_add', [[1, 2, 3, 4], [5, 6, 7, 8]], [[9, 10, 11, 12], [13, 14, 15, 16]]), [[10, 12, 14, 16], [18, 20, 22, 24]], 'operation("m_add",[[1,2,3,4],[5,6,7,8]],[[9,10,11,12],[13,14,15,16]]) should return [[10,12,14,16],[18,20,22,24]].'); + testString: assert.deepEqual(operation('m_add', [[1, 2, 3, 4], [5, 6, 7, 8]], [[9, 10, 11, 12], [13, 14, 15, 16]]), [[10, 12, 14, 16], [18, 20, 22, 24]]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md index 9e5557d563..7d1f053145 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/emirp-primes.english.md @@ -27,15 +27,15 @@ The function should accept two parameters. The first will receive n ```yml tests: - text: emirps is a function. - testString: assert(typeof emirps === 'function', 'emirps is a function.'); + testString: assert(typeof emirps === 'function'); - text: emirps(20,true) should return [13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389] - testString: assert.deepEqual(emirps(20, true), [13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389], 'emirps(20,true) should return [13,17,31,37,71,73,79,97,107,113,149,157,167,179,199,311,337,347,359,389]'); + testString: assert.deepEqual(emirps(20, true), [13, 17, 31, 37, 71, 73, 79, 97, 107, 113, 149, 157, 167, 179, 199, 311, 337, 347, 359, 389]); - text: emirps(10000) should return 948349 - testString: assert.deepEqual(emirps(10000), 948349, 'emirps(10000) should return 948349'); + testString: assert.deepEqual(emirps(10000), 948349); - text: emirps([7700,8000],true) should return [7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963] - testString: assert.deepEqual(emirps([7700, 8000], true), [7717, 7757, 7817, 7841, 7867, 7879, 7901, 7927, 7949, 7951, 7963], 'emirps([7700,8000],true) should return [7717,7757,7817,7841,7867,7879,7901,7927,7949,7951,7963]'); + testString: assert.deepEqual(emirps([7700, 8000], true), [7717, 7757, 7817, 7841, 7867, 7879, 7901, 7927, 7949, 7951, 7963]); - text: emirps([7700,8000],true) should return 11 - testString: assert.deepEqual(emirps([7700, 8000], false), 11, 'emirps([7700,8000],true) should return 11'); + testString: assert.deepEqual(emirps([7700, 8000], false), 11); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md index f8926c3741..85bbdb22ac 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/entropy.english.md @@ -23,19 +23,19 @@ where $count_i$ is the count of character $n_i$. ```yml tests: - text: entropy is a function. - testString: assert(typeof entropy === 'function', 'entropy is a function.'); + testString: assert(typeof entropy === 'function'); - text: entropy("0") should return 0 - testString: assert.equal(entropy('0'), 0, 'entropy("0") should return 0'); + testString: assert.equal(entropy('0'), 0); - text: entropy("01") should return 1 - testString: assert.equal(entropy('01'), 1, 'entropy("01") should return 1'); + testString: assert.equal(entropy('01'), 1); - text: entropy("0123") should return 2 - testString: assert.equal(entropy('0123'), 2, 'entropy("0123") should return 2'); + testString: assert.equal(entropy('0123'), 2); - text: entropy("01234567") should return 3 - testString: assert.equal(entropy('01234567'), 3, 'entropy("01234567") should return 3'); + testString: assert.equal(entropy('01234567'), 3); - text: entropy("0123456789abcdef") should return 4 - testString: assert.equal(entropy('0123456789abcdef'), 4, 'entropy("0123456789abcdef") should return 4'); + testString: assert.equal(entropy('0123456789abcdef'), 4); - text: entropy("1223334444") should return 1.8464393446710154 - testString: assert.equal(entropy('1223334444'), 1.8464393446710154, 'entropy("1223334444") should return 1.8464393446710154'); + testString: assert.equal(entropy('1223334444'), 1.8464393446710154); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md index 47ce45bd78..daa034af4a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/equilibrium-index.english.md @@ -41,19 +41,19 @@ Assume that the sequence may be very long. ```yml tests: - text: equilibrium is a function. - testString: assert(typeof equilibrium === 'function', 'equilibrium is a function.'); + testString: assert(typeof equilibrium === 'function'); - text: equilibrium([-7, 1, 5, 2, -4, 3, 0]) should return [3,6]. - testString: assert.deepEqual(equilibrium(equilibriumTests[0]), ans[0], 'equilibrium([-7, 1, 5, 2, -4, 3, 0]) should return [3,6].'); + testString: assert.deepEqual(equilibrium(equilibriumTests[0]), ans[0]); - text: equilibrium([2, 4, 6]) should return []. - testString: assert.deepEqual(equilibrium(equilibriumTests[1]), ans[1], 'equilibrium([2, 4, 6]) should return [].'); + testString: assert.deepEqual(equilibrium(equilibriumTests[1]), ans[1]); - text: equilibrium([2, 9, 2]) should return [1]. - testString: assert.deepEqual(equilibrium(equilibriumTests[2]), ans[2], 'equilibrium([2, 9, 2]) should return [1].'); + testString: assert.deepEqual(equilibrium(equilibriumTests[2]), ans[2]); - text: equilibrium([1, -1, 1, -1, 1, -1, 1]) should return [0,1,2,3,4,5,6]. - testString: assert.deepEqual(equilibrium(equilibriumTests[3]), ans[3], 'equilibrium([1, -1, 1, -1, 1, -1, 1]) should return [0,1,2,3,4,5,6].'); + testString: assert.deepEqual(equilibrium(equilibriumTests[3]), ans[3]); - text: equilibrium([1]) should return [0]. - testString: assert.deepEqual(equilibrium(equilibriumTests[4]), ans[4], 'equilibrium([1]) should return [0].'); + testString: assert.deepEqual(equilibrium(equilibriumTests[4]), ans[4]); - text: equilibrium([]) should return []. - testString: assert.deepEqual(equilibrium(equilibriumTests[5]), ans[5], 'equilibrium([]) should return [].'); + testString: assert.deepEqual(equilibrium(equilibriumTests[5]), ans[5]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md index fa4153a382..f6274ecc92 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/ethiopian-multiplication.english.md @@ -73,17 +73,17 @@ Use these functions to create a function that does Ethiopian multiplication. ```yml tests: - text: eth_mult is a function. - testString: assert(typeof eth_mult === 'function', 'eth_mult is a function.'); + testString: assert(typeof eth_mult === 'function'); - text: eth_mult(17,34) should return 578. - testString: assert.equal(eth_mult(17, 34), 578, 'eth_mult(17,34) should return 578.'); + testString: assert.equal(eth_mult(17, 34), 578); - text: eth_mult(23,46) should return 1058. - testString: assert.equal(eth_mult(23, 46), 1058, 'eth_mult(23,46) should return 1058.'); + testString: assert.equal(eth_mult(23, 46), 1058); - text: eth_mult(12,27) should return 324. - testString: assert.equal(eth_mult(12, 27), 324, 'eth_mult(12,27) should return 324.'); + testString: assert.equal(eth_mult(12, 27), 324); - text: eth_mult(56,98) should return 5488. - testString: assert.equal(eth_mult(56, 98), 5488, 'eth_mult(56,98) should return 5488.'); + testString: assert.equal(eth_mult(56, 98), 5488); - text: eth_mult(63,74) should return 4662. - testString: assert.equal(eth_mult(63, 74), 4662, 'eth_mult(63,74) should return 4662.'); + testString: assert.equal(eth_mult(63, 74), 4662); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md index 1c3044bf56..f2e7647e0c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/euler-method.english.md @@ -72,15 +72,15 @@ and to compare with the analytical solution. ```yml tests: - text: eulersMethod is a function. - testString: assert(typeof eulersMethod === 'function', 'eulersMethod is a function.'); + testString: assert(typeof eulersMethod === 'function'); - text: eulersMethod(0, 100, 100, 10) should return a number. - testString: assert(typeof eulersMethod(0, 100, 100, 10) === 'number', 'eulersMethod(0, 100, 100, 10) should return a number.'); + testString: assert(typeof eulersMethod(0, 100, 100, 10) === 'number'); - text: eulersMethod(0, 100, 100, 10) should return 20.0424631833732. - testString: assert.equal(eulersMethod(0, 100, 100, 2), 20.0424631833732, 'eulersMethod(0, 100, 100, 10) should return 20.0424631833732.'); + testString: assert.equal(eulersMethod(0, 100, 100, 2), 20.0424631833732); - text: eulersMethod(0, 100, 100, 10) should return 20.01449963666907. - testString: assert.equal(eulersMethod(0, 100, 100, 5), 20.01449963666907, 'eulersMethod(0, 100, 100, 10) should return 20.01449963666907.'); + testString: assert.equal(eulersMethod(0, 100, 100, 5), 20.01449963666907); - text: eulersMethod(0, 100, 100, 10) should return 20.000472392. - testString: assert.equal(eulersMethod(0, 100, 100, 10), 20.000472392, 'eulersMethod(0, 100, 100, 10) should return 20.000472392.'); + testString: assert.equal(eulersMethod(0, 100, 100, 10), 20.000472392); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md index 725ed90c07..edbeb86da8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/evaluate-binomial-coefficients.english.md @@ -22,17 +22,17 @@ $\binom{n}{k} = \frac{n!}{(n-k)!k!} = \frac{n(n-1)(n-2)\ldots(n-k+1)}{k(k-1)(k-2 ```yml tests: - text: binom is a function. - testString: assert(typeof binom === 'function', 'binom is a function.'); + testString: assert(typeof binom === 'function'); - text: binom(5,3) should return 10. - testString: assert.equal(binom(5, 3), 10, 'binom(5,3) should return 10.'); + testString: assert.equal(binom(5, 3), 10); - text: binom(7,2) should return 21. - testString: assert.equal(binom(7, 2), 21, 'binom(7,2) should return 21.'); + testString: assert.equal(binom(7, 2), 21); - text: binom(10,4) should return 210. - testString: assert.equal(binom(10, 4), 210, 'binom(10,4) should return 210.'); + testString: assert.equal(binom(10, 4), 210); - text: binom(6,1) should return 6. - testString: assert.equal(binom(6, 1), 6, 'binom(6,1) should return 6.'); + testString: assert.equal(binom(6, 1), 6); - text: binom(12,8) should return 495. - testString: assert.equal(binom(12, 8), 495, 'binom(12,8) should return 495.'); + testString: assert.equal(binom(12, 8), 495); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md index f6b47d18dd..729db02b84 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-a-markov-algorithm.english.md @@ -142,17 +142,17 @@ into ```yml tests: - text: markov is a function. - testString: assert(typeof markov === 'function', 'markov is a function.'); + testString: assert(typeof markov === 'function'); - text: markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from my brother.". - testString: assert.deepEqual(markov(rules[0],tests[0]),outputs[0],'markov(["A -> apple","B -> bag","S -> shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from my brother.".'); + testString: assert.deepEqual(markov(rules[0],tests[0]),outputs[0]); - text: markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from T shop.". - testString: assert.deepEqual(markov(rules[1],tests[1]),outputs[1],'markov(["A -> apple","B -> bag","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As from T S.") should return "I bought a bag of apples from T shop.".'); + testString: assert.deepEqual(markov(rules[1],tests[1]),outputs[1]); - text: markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.") should return "I bought a bag of apples with my money from T shop.". - testString: assert.deepEqual(markov(rules[2],tests[2]),outputs[2],'markov(["A -> apple","WWWW -> with","Bgage -> ->.*","B -> bag","->.* -> money","W -> WW","S -> .shop","T -> the","the shop -> my brother","a never used -> .terminating rule"],"I bought a B of As W my Bgage from T S.") should return "I bought a bag of apples with my money from T shop.".'); + testString: assert.deepEqual(markov(rules[2],tests[2]),outputs[2]); - text: markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_") should return "11111111111111111111". - testString: assert.deepEqual(markov(rules[3],tests[3]),outputs[3],'markov(["_+1 -> _1+","1+1 -> 11+","1! -> !1",",! -> !+","_! -> _","1*1 -> x,@y","1x -> xX","X, -> 1,1","X1 -> 1X","_x -> _X",",x -> ,X","y1 -> 1y","y_ -> _","1@1 -> x,@y","1@_ -> @_",",@_ -> !_","++ -> +","_1 -> 1","1+_ -> 1","_+_ -> "],"_1111*11111_") should return "11111111111111111111".'); + testString: assert.deepEqual(markov(rules[3],tests[3]),outputs[3]); - text: markov(["A0 -> 1B","0A1 -> C01","1A1 -> C11","0B0 -> A01","1B0 -> A11","B1 -> 1B","0C0 -> B01","1C0 -> B11","0C1 -> H01","1C1 -> H11"],"") should return "00011H1111000". - testString: assert.deepEqual(markov(rules[4],tests[4]),outputs[4],'markov(["A0 -> 1B","0A1 -> C01","1A1 -> C11","0B0 -> A01","1B0 -> A11","B1 -> 1B","0C0 -> B01","1C0 -> B11","0C1 -> H01","1C1 -> H11"],"") should return "00011H1111000".'); + testString: assert.deepEqual(markov(rules[4],tests[4]),outputs[4]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md index ba61a7402d..df14c31ad9 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/execute-brain.english.md @@ -35,15 +35,15 @@ Any cell size is allowed, EOF (End-O-File) support is optio ```yml tests: - text: brain(bye) should return a string - testString: assert(typeof brain(bye) === 'string', 'brain(bye) should return a string'); + testString: assert(typeof brain(bye) === 'string'); - text: brain("++++++[>++++++++++<-]>+++++.")++++++++++<-]>+++++."),"A", 'brain("++++++[>++++++++++<-]>+++++.")++++++++++<-]>+++++."),"A"); - text: brain(bye) should return Goodbye, World!\\r\\n testString: assert.equal(brain(bye), 'Goodbye, World!\r\n', 'brain(bye) should return Goodbye, World!\\r\\n'); - - text: brain(hello) should return Hello World!\\n' - testString: assert.equal(brain(hello), "Hello World!\n", 'brain(hello) should return Hello World!\\n'); + - text: brain(hello) should return Hello World!\\n + testString: assert.equal(brain(hello), "Hello World!\n"); - text: brain(fib) should return 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 - testString: assert.equal(brain(fib), "1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89", 'brain(fib) should return 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89'); + testString: assert.equal(brain(fib), "1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89"); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md index e4f5cc7909..8b910161fd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/extensible-prime-generator.english.md @@ -28,15 +28,15 @@ The function should have two parameters. The first will receive n o ```yml tests: - text: primeGenerator is a function. - testString: assert(typeof primeGenerator === 'function', 'primeGenerator is a function.'); + testString: assert(typeof primeGenerator === 'function'); - text: primeGenerator is a function. - testString: assert.deepEqual(primeGenerator(20, true), [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71], 'primeGenerator is a function.'); + testString: assert.deepEqual(primeGenerator(20, true), [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71]); - text: primeGenerator is a function. - testString: assert.deepEqual(primeGenerator([100, 150], true), [101, 103, 107, 109, 113, 127, 131, 137, 139, 149], 'primeGenerator is a function.'); + testString: assert.deepEqual(primeGenerator([100, 150], true), [101, 103, 107, 109, 113, 127, 131, 137, 139, 149]); - text: primeGenerator is a function. - testString: assert.equal(primeGenerator([7700, 8000], false), 30, 'primeGenerator is a function.'); + testString: assert.equal(primeGenerator([7700, 8000], false), 30); - text: primeGenerator is a function. - testString: assert.equal(primeGenerator(10000, false), 104729, 'primeGenerator is a function.'); + testString: assert.equal(primeGenerator(10000, false), 104729); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md index c6207c3a53..410fe1c065 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factorial.english.md @@ -30,9 +30,9 @@ For example: ```yml tests: - text: factorial is a function. - testString: assert(typeof factorial === 'function', 'factorial is a function.'); + testString: assert(typeof factorial === 'function'); - text: factorial(2) should return a number. - testString: assert(typeof factorial(2) === 'number', 'factorial(2) should return a number.'); + testString: assert(typeof factorial(2) === 'number'); - text: factorial(3) should return 6. testString: assert.equal(factorial(3),results[0]); - text: factorial(3) should return 120. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md index 28653716a0..86125765c1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-a-mersenne-number.english.md @@ -46,15 +46,15 @@ Using the above method find a factor of 2929-1 (aka M92 ```yml tests: - text: check_mersenne is a function. - testString: assert(typeof check_mersenne === 'function', 'check_mersenne is a function.'); + testString: assert(typeof check_mersenne === 'function'); - text: check_mersenne(3) should return a string. - testString: assert(typeof check_mersenne(3) == 'string', 'check_mersenne(3) should return a string.'); + testString: assert(typeof check_mersenne(3) == 'string'); - text: check_mersenne(3) should return "M3 = 2^3-1 is prime". - testString: assert.equal(check_mersenne(3),"M3 = 2^3-1 is prime",'check_mersenne(3) should return "M3 = 2^3-1 is prime".'); + testString: assert.equal(check_mersenne(3),"M3 = 2^3-1 is prime"); - text: check_mersenne(23) should return "M23 = 2^23-1 is composite with factor 47". - testString: assert.equal(check_mersenne(23),"M23 = 2^23-1 is composite with factor 47",'check_mersenne(23) should return "M23 = 2^23-1 is composite with factor 47".'); + testString: assert.equal(check_mersenne(23),"M23 = 2^23-1 is composite with factor 47"); - text: check_mersenne(929) should return "M929 = 2^929-1 is composite with factor 13007 - testString: assert.equal(check_mersenne(929),"M929 = 2^929-1 is composite with factor 13007",'check_mersenne(929) should return "M929 = 2^929-1 is composite with factor 13007'); + testString: assert.equal(check_mersenne(929),"M929 = 2^929-1 is composite with factor 13007"); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md index b45e8cdfc3..d262ea8151 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/factors-of-an-integer.english.md @@ -21,13 +21,13 @@ These factors are the positive integers by which the number being factored can b ```yml tests: - text: factors is a function. - testString: assert(typeof factors === 'function', 'factors is a function.'); + testString: assert(typeof factors === 'function'); - text: factors(45) should return [1,3,5,9,15,45]. - testString: assert.deepEqual(factors(45), ans[0], 'factors(45) should return [1,3,5,9,15,45].'); + testString: assert.deepEqual(factors(45), ans[0]); - text: factors(53) should return [1,53]. - testString: assert.deepEqual(factors(53), ans[1], 'factors(53) should return [1,53].'); + testString: assert.deepEqual(factors(53), ans[1]); - text: factors(64) should return [1,2,4,8,16,32,64]. - testString: assert.deepEqual(factors(64), ans[2], 'factors(64) should return [1,2,4,8,16,32,64].'); + testString: assert.deepEqual(factors(64), ans[2]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md index 22b56c35c5..715e136478 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/farey-sequence.english.md @@ -34,15 +34,15 @@ Write a function that returns the Farey sequence of order n. The fu ```yml tests: - text: farey is a function. - testString: assert(typeof farey === 'function', 'farey is a function.'); + testString: assert(typeof farey === 'function'); - text: farey(3) should return an array - testString: assert(Array.isArray(farey(3)), 'farey(3) should return an array'); + testString: assert(Array.isArray(farey(3))); - text: farey(3) should return ["1/3","1/2","2/3"] - testString: assert.deepEqual(farey(3), ["1/3","1/2","2/3"], 'farey(3) should return ["1/3","1/2","2/3"]'); + testString: assert.deepEqual(farey(3), ["1/3","1/2","2/3"]); - text: farey(4) should return ["1/4","1/3","1/2","2/4","2/3","3/4"] - testString: assert.deepEqual(farey(4), ["1/4","1/3","1/2","2/4","2/3","3/4"], 'farey(4) should return ["1/4","1/3","1/2","2/4","2/3","3/4"]'); + testString: assert.deepEqual(farey(4), ["1/4","1/3","1/2","2/4","2/3","3/4"]); - text: farey(5) should return ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"] - testString: assert.deepEqual(farey(5), ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"], 'farey(5) should return ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]'); + testString: assert.deepEqual(farey(5), ["1/5","1/4","1/3","2/5","1/2","2/4","3/5","2/3","3/4","4/5"]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md index 3c54c6cd1b..2e6323225d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-n-step-number-sequences.english.md @@ -42,21 +42,21 @@ Write a function to generate Fibonacci $n$-step number sequences and Lucas seque ```yml tests: - text: fib_luc is a function. - testString: assert(typeof fib_luc === 'function', 'fib_luc is a function.'); + testString: assert(typeof fib_luc === 'function'); - text: fib_luc(2,10,"f") should return [1,1,2,3,5,8,13,21,34,55]. - testString: assert.deepEqual(fib_luc(2,10,"f"),ans[0],'fib_luc(2,10,"f") should return [1,1,2,3,5,8,13,21,34,55].'); + testString: assert.deepEqual(fib_luc(2,10,"f"),ans[0]); - text: fib_luc(3,15,"f") should return [1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136]. - testString: assert.deepEqual(fib_luc(3,15,"f"),ans[1],'fib_luc(3,15,"f") should return [1,1,2,4,7,13,24,44,81,149,274,504,927,1705,3136].'); + testString: assert.deepEqual(fib_luc(3,15,"f"),ans[1]); - text: fib_luc(4,15,"f") should return [1,1,2,4,8,15,29,56,108,208,401,773,1490,2872,5536]. - testString: assert.deepEqual(fib_luc(4,15,"f"),ans[2],'fib_luc(4,15,"f") should return [1,1,2,4,8,15,29,56,108,208,401,773,1490,2872,5536].'); + testString: assert.deepEqual(fib_luc(4,15,"f"),ans[2]); - text: fib_luc(2,10,"l") should return [ 2, 1, 3, 4, 7, 11, 18, 29, 47, 76]. - testString: assert.deepEqual(fib_luc(2,10,"l"),ans[3],'fib_luc(2,10,"l") should return [ 2, 1, 3, 4, 7, 11, 18, 29, 47, 76].'); + testString: assert.deepEqual(fib_luc(2,10,"l"),ans[3]); - text: fib_luc(3,15,"l") should return [ 2, 1, 3, 6, 10, 19, 35, 64, 118, 217, 399, 734, 1350, 2483, 4567 ]. - testString: assert.deepEqual(fib_luc(3,15,"l"),ans[4],'fib_luc(3,15,"l") should return [ 2, 1, 3, 6, 10, 19, 35, 64, 118, 217, 399, 734, 1350, 2483, 4567 ].'); + testString: assert.deepEqual(fib_luc(3,15,"l"),ans[4]); - text: fib_luc(4,15,"l") should return [ 2, 1, 3, 6, 12, 22, 43, 83, 160, 308, 594, 1145, 2207, 4254, 8200 ]. - testString: assert.deepEqual(fib_luc(4,15,"l"),ans[5],'fib_luc(4,15,"l") should return [ 2, 1, 3, 6, 12, 22, 43, 83, 160, 308, 594, 1145, 2207, 4254, 8200 ].'); + testString: assert.deepEqual(fib_luc(4,15,"l"),ans[5]); - text: fib_luc(5,15,"l") should return [ 2, 1, 3, 6, 12, 24, 46, 91, 179, 352, 692, 1360, 2674, 5257, 10335 ]. - testString: assert.deepEqual(fib_luc(5,15,"l"),ans[6],'fib_luc(5,15,"l") should return [ 2, 1, 3, 6, 12, 24, 46, 91, 179, 352, 692, 1360, 2674, 5257, 10335 ].'); + testString: assert.deepEqual(fib_luc(5,15,"l"),ans[6]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md index ec95632881..974dda4b54 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fibonacci-sequence.english.md @@ -24,9 +24,9 @@ Hence, the series is: 0, 1, 1, 2, 3, 5, 8, 13... ```yml tests: - text: fibonacci is a function. - testString: assert(typeof fibonacci === 'function', 'fibonacci is a function.'); + testString: assert(typeof fibonacci === 'function'); - text: fibonacci(2) should return a number. - testString: assert(typeof fibonacci(2) == 'number', 'fibonacci(2) should return a number.'); + testString: assert(typeof fibonacci(2) == 'number'); - text: fibonacci(3) should return 1. testString: assert.equal(fibonacci(3),1); - text: fibonacci(5) should return 3. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md index 92d1de9687..95a492b005 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/fractran.english.md @@ -33,19 +33,19 @@ Write a function that takes a fractran program as a string parameter and returns ```yml tests: - text: fractran should be a function. - testString: assert(typeof fractran=='function','fractran should be a function.'); + testString: assert(typeof fractran=='function'); - text: fractran("3/2, 1/3") should return an array. - testString: assert(Array.isArray(fractran('3/2, 1/3')),'fractran("3/2, 1/3") should return an array.'); + testString: assert(Array.isArray(fractran('3/2, 1/3'))); - text: fractran("3/2, 1/3") should return [ 2, 3, 1 ]. - testString: assert.deepEqual(fractran('3/2, 1/3'), [ 2, 3, 1 ],'fractran("3/2, 1/3") should return [ 2, 3, 1 ].'); + testString: assert.deepEqual(fractran('3/2, 1/3'), [ 2, 3, 1 ]); - text: fractran("3/2, 5/3, 1/5") should return [ 2, 3, 5, 1 ]. - testString: assert.deepEqual(fractran('3/2, 5/3, 1/5'), [ 2, 3, 5, 1 ],'fractran("3/2, 5/3, 1/5") should return [ 2, 3, 5, 1 ].'); + testString: assert.deepEqual(fractran('3/2, 5/3, 1/5'), [ 2, 3, 5, 1 ]); - text: fractran("3/2, 6/3") should return [ 2, 3, 6, 9, 18, 27, 54, 81, 162, 243 ]. - testString: assert.deepEqual(fractran('3/2, 6/3'), [ 2, 3, 6, 9, 18, 27, 54, 81, 162, 243 ],'fractran("3/2, 6/3") should return [ 2, 3, 6, 9, 18, 27, 54, 81, 162, 243 ].'); + testString: assert.deepEqual(fractran('3/2, 6/3'), [ 2, 3, 6, 9, 18, 27, 54, 81, 162, 243 ]); - text: fractran("2/7, 7/2") should return [ 2, 7, 2, 7, 2, 7, 2, 7, 2, 7 ]. - testString: assert.deepEqual(fractran('2/7, 7/2'), [ 2, 7, 2, 7, 2, 7, 2, 7, 2, 7 ],'fractran("2/7, 7/2") should return [ 2, 7, 2, 7, 2, 7, 2, 7, 2, 7 ].'); + testString: assert.deepEqual(fractran('2/7, 7/2'), [ 2, 7, 2, 7, 2, 7, 2, 7, 2, 7 ]); - text: fractran("17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1") should return [ 2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290 ]. - testString: assert.deepEqual(fractran('17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1'), [ 2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290 ],'fractran("17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1") should return [ 2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290 ].'); + testString: assert.deepEqual(fractran('17/91, 78/85, 19/51, 23/38, 29/33, 77/29, 95/23, 77/19, 1/17, 11/13, 13/11, 15/14, 15/2, 55/1'), [ 2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290 ]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md index de18a3562a..3b19b5acc3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gaussian-elimination.english.md @@ -22,19 +22,19 @@ To improve accuracy, please use partial pivoting and scaling. ```yml tests: - text: gaussianElimination should be a function. - testString: assert(typeof gaussianElimination=='function','gaussianElimination should be a function.'); + testString: assert(typeof gaussianElimination=='function'); - text: gaussianElimination([[1,1],[1,-1]], [5,1]) should return an array. - testString: assert(Array.isArray(gaussianElimination([[1,1],[1,-1]], [5,1])),'gaussianElimination([[1,1],[1,-1]], [5,1]) should return an array.'); + testString: assert(Array.isArray(gaussianElimination([[1,1],[1,-1]], [5,1]))); - text: gaussianElimination([[1,1],[1,-1]], [5,1]) should return [ 3, 2 ]. - testString: assert.deepEqual(gaussianElimination([[1,1],[1,-1]], [5,1]), [ 3, 2 ],'gaussianElimination([[1,1],[1,-1]], [5,1]) should return [ 3, 2 ].'); + testString: assert.deepEqual(gaussianElimination([[1,1],[1,-1]], [5,1]), [ 3, 2 ]); - text: gaussianElimination([[2,3],[2,1]] , [8,4]) should return [ 1, 2 ]. - testString: assert.deepEqual(gaussianElimination([[2,3],[2,1]] , [8,4]), [ 1, 2 ],'gaussianElimination([[2,3],[2,1]] , [8,4]) should return [ 1, 2 ].'); + testString: assert.deepEqual(gaussianElimination([[2,3],[2,1]] , [8,4]), [ 1, 2 ]); - text: gaussianElimination([[1,3],[5,-2]], [14,19]) should return [ 5, 3 ]. - testString: assert.deepEqual(gaussianElimination([[1,3],[5,-2]], [14,19]), [ 5, 3 ],'gaussianElimination([[1,3],[5,-2]], [14,19]) should return [ 5, 3 ].'); + testString: assert.deepEqual(gaussianElimination([[1,3],[5,-2]], [14,19]), [ 5, 3 ]); - text: gaussianElimination([[1,1],[5,-1]] , [10,14]) should return [ 4, 6 ]. - testString: assert.deepEqual(gaussianElimination([[1,1],[5,-1]] , [10,14]), [ 4, 6 ],'gaussianElimination([[1,1],[5,-1]] , [10,14]) should return [ 4, 6 ].'); + testString: assert.deepEqual(gaussianElimination([[1,1],[5,-1]] , [10,14]), [ 4, 6 ]); - text: gaussianElimination([[1,2,3],[4,5,6],[7,8,8]] , [6,15,23]) should return [ 1, 1, 1 ]. - testString: assert.deepEqual(gaussianElimination([[1,2,3],[4,5,6],[7,8,8]] , [6,15,23]), [ 1, 1, 1 ],'gaussianElimination([[1,2,3],[4,5,6],[7,8,8]] , [6,15,23]) should return [ 1, 1, 1 ].'); + testString: assert.deepEqual(gaussianElimination([[1,2,3],[4,5,6],[7,8,8]] , [6,15,23]), [ 1, 1, 1 ]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md index 5a6eb3bbf1..9d91dee6a6 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/general-fizzbuzz.english.md @@ -24,23 +24,23 @@ The second parameter is the number for which the function should return a string ```yml tests: - text: genFizzBuzz should be a function. - testString: assert(typeof genFizzBuzz=='function','genFizzBuzz should be a function.'); + testString: assert(typeof genFizzBuzz=='function'); - text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6) should return a string. - testString: assert(typeof genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)=='string','genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6) should return a string.'); + testString: assert(typeof genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6)=='string'); - text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6) should return "Fizz". - testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6), "Fizz",'genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6) should return "Fizz".'); + testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 6), "Fizz"); - text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10) should return "Buzz". - testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10), "Buzz",'genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10) should return "Buzz".'); + testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 10), "Buzz"); - text: genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12) should return "Buzz". - testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12), "Buzz",'genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12) should return "Buzz".'); + testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 12), "Buzz"); - text: genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13) should return "13". - testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13), '13','genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13) should return "13".'); + testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 13), '13'); - text: genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15) should return "BuzzFizz". - testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15), 'BuzzFizz','genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15) should return "BuzzFizz".'); + testString: assert.equal(genFizzBuzz([[3, "Buzz"],[5, "Fizz"]], 15), "BuzzFizz"); - text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15) should return "FizzBuzz". - testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15), 'FizzBuzz','genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15) should return "FizzBuzz".'); + testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"]], 15), "FizzBuzz"); - text: genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105) should return "FizzBuzzBaxx". - testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105), 'FizzBuzzBaxx','genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105) should return "FizzBuzzBaxx".'); + testString: assert.equal(genFizzBuzz([[3, "Fizz"],[5, "Buzz"],[7, "Baxx"]], 105), "FizzBuzzBaxx"); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md index fb2d531df1..f7c1dde486 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generate-lower-case-ascii-alphabet.english.md @@ -20,19 +20,19 @@ Write a function to generate an array of lower case ASCII characters for a given ```yml tests: - text: lascii should be a function. - testString: assert(typeof lascii=='function','lascii should be a function.'); + testString: assert(typeof lascii=='function'); - text: lascii("a","d") should return an array. - testString: assert(Array.isArray(lascii('a','d')),'lascii("a","d") should return an array.'); + testString: assert(Array.isArray(lascii('a','d'))); - text: "lascii('a','d') should return [ 'a', 'b', 'c', 'd' ]." - testString: assert.deepEqual(lascii("a","d"),results[0],"lascii('a','d') should return [ 'a', 'b', 'c', 'd' ]."); + testString: assert.deepEqual(lascii("a","d"),results[0]); - text: lascii('c','i') should return [ 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]. - testString: assert.deepEqual(lascii("c","i"),results[1],"lascii('c','i') should return [ 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]."); + testString: assert.deepEqual(lascii("c","i"),results[1]); - text: lascii('m','q') should return [ 'm', 'n', 'o', 'p', 'q' ]. - testString: assert.deepEqual(lascii("m","q"),results[2],"lascii('m','q') should return [ 'm', 'n', 'o', 'p', 'q' ]."); + testString: assert.deepEqual(lascii("m","q"),results[2]); - text: lascii('k','n') should return [ 'k', 'l', 'm', 'n' ]. - testString: assert.deepEqual(lascii("k","n"),results[3],"lascii('k','n') should return [ 'k', 'l', 'm', 'n' ]."); + testString: assert.deepEqual(lascii("k","n"),results[3]); - text: lascii('t','z') should return [ 't', 'u', 'v', 'w', 'x', 'y', 'z' ]. - testString: assert.deepEqual(lascii("t","z"),results[4],"lascii('t','z') should return [ 't', 'u', 'v', 'w', 'x', 'y', 'z' ]."); + testString: assert.deepEqual(lascii("t","z"),results[4]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md index 4ab5f16966..885801a319 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/generatorexponential.english.md @@ -24,19 +24,19 @@ For example for \(n=7\), the function should return 81 as the sequence would be ```yml tests: - text: exponentialGenerator should be a function. - testString: assert(typeof exponentialGenerator=='function','exponentialGenerator should be a function.'); + testString: assert(typeof exponentialGenerator=='function'); - text: exponentialGenerator() should return a number. - testString: assert(typeof exponentialGenerator(10)=='number','exponentialGenerator() should return a number.'); + testString: assert(typeof exponentialGenerator(10)=='number'); - text: exponentialGenerator(10) should return 144. - testString: assert.equal(exponentialGenerator(10),144,'exponentialGenerator(10) should return 144.'); + testString: assert.equal(exponentialGenerator(10),144); - text: exponentialGenerator(12) should return 196. - testString: assert.equal(exponentialGenerator(12),196,'exponentialGenerator(12) should return 196.'); + testString: assert.equal(exponentialGenerator(12),196); - text: exponentialGenerator(14) should return 256. - testString: assert.equal(exponentialGenerator(14),256,'exponentialGenerator(14) should return 256.'); + testString: assert.equal(exponentialGenerator(14),256); - text: exponentialGenerator(20) should return 484. - testString: assert.equal(exponentialGenerator(20),484,'exponentialGenerator(20) should return 484.'); + testString: assert.equal(exponentialGenerator(20),484); - text: exponentialGenerator(25) should return 784. - testString: assert.equal(exponentialGenerator(25),784,'exponentialGenerator(25) should return 784.'); + testString: assert.equal(exponentialGenerator(25),784); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md index 96d8472aff..724f5b4167 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/gray-code.english.md @@ -42,21 +42,21 @@ b[i] = g[i] xor b[i-1] ```yml tests: - text: gray should be a function. - testString: assert(typeof gray=='function','gray should be a function.'); + testString: assert(typeof gray=='function'); - text: gray(true,177) should return a number. - testString: assert(typeof gray(true,177)=='number','gray(true,177) should return a number.'); + testString: assert(typeof gray(true,177)=='number'); - text: gray(true,177) should return 233. - testString: assert.equal(gray(true,177),233,'gray(true,177) should return 233.'); + testString: assert.equal(gray(true,177),233); - text: gray(true,425) should return 381. - testString: assert.equal(gray(true,425),381,'gray(true,425) should return 381.'); + testString: assert.equal(gray(true,425),381); - text: gray(true,870) should return 725. - testString: assert.equal(gray(true,870),725,'gray(true,870) should return 725.'); + testString: assert.equal(gray(true,870),725); - text: gray(false,233) should return 177. - testString: assert.equal(gray(false,233),177,'gray(false,233) should return 177.'); + testString: assert.equal(gray(false,233),177); - text: gray(false,381) should return 425. - testString: assert.equal(gray(false,381),425,'gray(false,381) should return 425.'); + testString: assert.equal(gray(false,381),425); - text: gray(false,725) should return 870. - testString: assert.equal(gray(false,725),870,'gray(false,725) should return 870.'); + testString: assert.equal(gray(false,725),870); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md index 64312c67e3..8d39090b64 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-common-divisor.english.md @@ -20,21 +20,21 @@ Write a function that returns the greatest common divisor of two integers. ```yml tests: - text: gcd should be a function. - testString: assert(typeof gcd=='function','gcd should be a function.'); + testString: assert(typeof gcd=='function'); - text: gcd(24,36) should return a number. - testString: assert(typeof gcd(24,36)=='number','gcd(24,36) should return a number.'); + testString: assert(typeof gcd(24,36)=='number'); - text: gcd(24,36) should return 12. - testString: assert.equal(gcd(24,36),12,'gcd(24,36) should return 12.'); + testString: assert.equal(gcd(24,36),12); - text: gcd(30,48) should return 6. - testString: assert.equal(gcd(30,48),6,'gcd(30,48) should return 6.'); + testString: assert.equal(gcd(30,48),6); - text: gcd(10,15) should return 5. - testString: assert.equal(gcd(10,15),5,'gcd(10,15) should return 5.'); + testString: assert.equal(gcd(10,15),5); - text: gcd(100,25) should return 25. - testString: assert.equal(gcd(100,25),25,'gcd(100,25) should return 25.'); + testString: assert.equal(gcd(100,25),25); - text: gcd(13,250) should return 1. - testString: assert.equal(gcd(13,250),1,'gcd(13,250) should return 1.'); + testString: assert.equal(gcd(13,250),1); - text: gcd(1300,250) should return 50. - testString: assert.equal(gcd(1300,250),50,'gcd(1300,250) should return 50.'); + testString: assert.equal(gcd(1300,250),50); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md index f63624883b..2bc7503970 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/greatest-subsequential-sum.english.md @@ -21,21 +21,21 @@ An empty subsequence is considered to have the sum of \( 0 \); thus if all elem ```yml tests: - text: maximumSubsequence should be a function. - testString: assert(typeof maximumSubsequence=='function','maximumSubsequence should be a function.'); + testString: assert(typeof maximumSubsequence=='function'); - text: maximumSubsequence([ 1, 2, -1, 3, 10, -10 ]) should return an array. - testString: assert(Array.isArray(maximumSubsequence([ 1, 2,-1, 3, 10, -10 ])),'maximumSubsequence([ 1, 2, -1, 3, 10, -10 ]) should return an array.'); + testString: assert(Array.isArray(maximumSubsequence([ 1, 2,-1, 3, 10, -10 ]))); - text: maximumSubsequence([ 1, 2, -1, 3, 10, -10 ]) should return [ 1, 2, -1, 3, 10 ]. - testString: assert.deepEqual(maximumSubsequence([1,2,-1,3,10,-10]), [ 1, 2, -1, 3, 10 ],'maximumSubsequence([ 1, 2, -1, 3, 10, -10 ]) should return [ 1, 2, -1, 3, 10 ].'); + testString: assert.deepEqual(maximumSubsequence([1,2,-1,3,10,-10]), [ 1, 2, -1, 3, 10 ]); - text: maximumSubsequence([ 0, 8, 10, -2, -4, -1, -5, -3 ]) should return [ 0, 8, 10 ]. - testString: assert.deepEqual(maximumSubsequence([0, 8, 10, -2, -4, -1, -5, -3]), [ 0, 8, 10 ],'maximumSubsequence([ 0, 8, 10, -2, -4, -1, -5, -3 ]) should return [ 0, 8, 10 ].'); + testString: assert.deepEqual(maximumSubsequence([0, 8, 10, -2, -4, -1, -5, -3]), [ 0, 8, 10 ]); - text: maximumSubsequence([ 9, 9, -10, 1 ]) should return [ 9, 9 ]. - testString: assert.deepEqual(maximumSubsequence([ 9, 9, -10, 1 ]), [ 9, 9 ],'maximumSubsequence([ 9, 9, -10, 1 ]) should return [ 9, 9 ].'); + testString: assert.deepEqual(maximumSubsequence([ 9, 9, -10, 1 ]), [ 9, 9 ]); - text: maximumSubsequence([ 7, 1, -5, -3, -8, 1 ] should return [ 7, 1 ]. - testString: assert.deepEqual(maximumSubsequence([ 7, 1, -5, -3, -8, 1 ]), [ 7, 1 ],'maximumSubsequence([ 7, 1, -5, -3, -8, 1 ] should return [ 7, 1 ].'); + testString: assert.deepEqual(maximumSubsequence([ 7, 1, -5, -3, -8, 1 ]), [ 7, 1 ]); - text: maximumSubsequence([ -3, 6, -1, 4, -4, -6 ]) should return [ 6, -1, 4 ]. - testString: assert.deepEqual(maximumSubsequence([ -3, 6, -1, 4, -4, -6 ]), [ 6, -1, 4 ],'maximumSubsequence([ -3, 6, -1, 4, -4, -6 ]) should return [ 6, -1, 4 ].'); + testString: assert.deepEqual(maximumSubsequence([ -3, 6, -1, 4, -4, -6 ]), [ 6, -1, 4 ]); - text: maximumSubsequence([ -1, -2, 3, 5, 6, -2, -1, 4, -4, 2, -1 ]) should return [ 3, 5, 6, -2, -1, 4 ]. - testString: assert.deepEqual(maximumSubsequence([ -1, -2, 3, 5, 6, -2, -1, 4, -4, 2, -1 ]), [ 3, 5, 6, -2, -1, 4 ],'maximumSubsequence([ -1, -2, 3, 5, 6, -2, -1, 4, -4, 2, -1 ]) should return [ 3, 5, 6, -2, -1, 4 ].'); + testString: assert.deepEqual(maximumSubsequence([ -1, -2, 3, 5, 6, -2, -1, 4, -4, 2, -1 ]), [ 3, 5, 6, -2, -1, 4 ]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md index b987b4f312..45ca2df11d 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hailstone-sequence.english.md @@ -35,9 +35,9 @@ The hailstone sequence is also known as hailstone numbers (because the values ar ```yml tests: - text: hailstoneSequence is a function. - testString: assert(typeof hailstoneSequence === 'function', 'hailstoneSequence is a function.'); + testString: assert(typeof hailstoneSequence === 'function'); - text: hailstoneSequence() should return [[27,82,41,124,8,4,2,1], [351, 77031]] - testString: assert.deepEqual(hailstoneSequence(), res, 'hailstoneSequence() should return [[27,82,41,124,8,4,2,1], [351, 77031]]'); + testString: assert.deepEqual(hailstoneSequence(), res); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md index 25a3c98df2..bb73469b4e 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/happy-numbers.english.md @@ -21,31 +21,31 @@ Implement a function that returns true if the number is happy, or false if not. ```yml tests: - text: happy is a function. - testString: assert(typeof happy === 'function', 'happy is a function.'); + testString: assert(typeof happy === 'function'); - text: happy(1) should return a boolean. - testString: assert(typeof happy(1) === 'boolean', 'happy(1) should return a boolean.'); + testString: assert(typeof happy(1) === 'boolean'); - text: happy(1) should return true. - testString: assert(happy(1), 'happy(1) should return true.'); + testString: assert(happy(1)); - text: happy(2) should return false. - testString: assert(!happy(2), 'happy(2) should return false.'); + testString: assert(!happy(2)); - text: happy(7) should return true. - testString: assert(happy(7), 'happy(7) should return true.'); + testString: assert(happy(7)); - text: happy(10) should return true. - testString: assert(happy(10), 'happy(10) should return true.'); + testString: assert(happy(10)); - text: happy(13) should return true. - testString: assert(happy(13), 'happy(13) should return true.'); + testString: assert(happy(13)); - text: happy(19) should return true. - testString: assert(happy(19), 'happy(19) should return true.'); + testString: assert(happy(19)); - text: happy(23) should return true. - testString: assert(happy(23), 'happy(23) should return true.'); + testString: assert(happy(23)); - text: happy(28) should return true. - testString: assert(happy(28), 'happy(28) should return true.'); + testString: assert(happy(28)); - text: happy(31) should return true. - testString: assert(happy(31), 'happy(31) should return true.'); + testString: assert(happy(31)); - text: happy(32) should return true:. - testString: assert(happy(32), 'happy(32) should return true:.'); + testString: assert(happy(32)); - text: happy(33) should return false. - testString: assert(!happy(33), 'happy(33) should return false.'); + testString: assert(!happy(33)); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md index 1e0da5adb8..5a83657613 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/harshad-or-niven-series.english.md @@ -23,7 +23,7 @@ Use it to list the first twenty members of the sequence and list the first Harsh ```yml tests: - text: isHarshadOrNiven is a function. - testString: assert(typeof isHarshadOrNiven === 'function', 'isHarshadOrNiven is a function.'); + testString: assert(typeof isHarshadOrNiven === 'function'); - text: 'isHarshadOrNiven() should return {"firstTwenty": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 18, 20, 21, 24, 27, 30, 36, 40, 42],"firstOver1000": 1002}' testString: assert.deepEqual(isHarshadOrNiven(), res); diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md index db5cb3b5c5..1ab7376923 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-from-two-arrays.english.md @@ -24,7 +24,7 @@ Using two Arrays of equal length, create a Hash object where the elements from o ```yml tests: - text: arrToObj is a function. - testString: assert(typeof arrToObj === 'function', 'arrToObj is a function.'); + testString: assert(typeof arrToObj === 'function'); - text: 'arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d", "e"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: "e" }' testString: assert.deepEqual(arrToObj(...testCases[0]), res[0]); - text: 'arrToObj([1, 2, 3, 4, 5], ["a", "b", "c", "d"]) should return { 1: "a", 2: "b", 3: "c", 4: "d", 5: undefined }' diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md index 67a9fb43d0..735b0f4ba1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hash-join.english.md @@ -173,7 +173,7 @@ The order of the rows in the output table is not significant. ```yml tests: - text: hashJoin is a function. - testString: assert(typeof hashJoin === 'function', 'hashJoin is a function.'); + testString: assert(typeof hashJoin === 'function'); - text: 'hashJoin([{ age: 27, name: "Jonah" }, { age: 18, name: "Alan" }, { age: 28, name: "Glory" }, { age: 18, name: "Popeye" }, { age: 28, name: "Alan" }], [{ character: "Jonah", nemesis: "Whales" }, { character: "Jonah", nemesis: "Spiders" }, { character: "Alan", nemesis: "Ghosts" }, { character:"Alan", nemesis: "Zombies" }, { character: "Glory", nemesis: "Buffy" }, { character: "Bob", nemesis: "foo" }]) should return [{"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Whales"}, {"A_age": 27,"A_name": "Jonah", "B_character": "Jonah", "B_nemesis": "Spiders"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 18,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}, {"A_age": 28,"A_name": "Glory", "B_character": "Glory", "B_nemesis": "Buffy"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Ghosts"}, {"A_age": 28,"A_name": "Alan", "B_character": "Alan", "B_nemesis": "Zombies"}]' testString: assert.deepEqual(hashJoin(hash1, hash2), res); diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md index c0fc662a6d..6d4140f2ff 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/heronian-triangles.english.md @@ -29,15 +29,15 @@ Implement a function based on Hero's formula that returns the first n ```yml tests: - text: heronianTriangle is a function. - testString: assert(typeof heronianTriangle === 'function', 'heronianTriangle is a function.'); + testString: assert(typeof heronianTriangle === 'function'); - text: heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17]] - testString: assert.deepEqual(heronianTriangle(testCases[0]), res[0], 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17]]'); + testString: assert.deepEqual(heronianTriangle(testCases[0]), res[0]); - text: heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15]], - testString: assert.deepEqual(heronianTriangle(testCases[1]), res[1], 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15]],'); + testString: assert.deepEqual(heronianTriangle(testCases[1]), res[1]); - text: heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53]], - testString: assert.deepEqual(heronianTriangle(testCases[2]), res[2], 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53]],'); + testString: assert.deepEqual(heronianTriangle(testCases[2]), res[2]); - text: heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53], [19, 20, 37],[16, 17, 17], [17, 17, 30], [16, 25, 39], [13, 20, 21]] - testString: assert.deepEqual(heronianTriangle(testCases[3]), res[3], 'heronianTriangle() should return [[3, 4, 5], [5, 5, 6], [5, 5, 8], [4, 13, 15], [5, 12, 13], [9, 10, 17], [3, 25, 26], [7, 15, 20], [10, 13, 13], [8, 15, 17], [13, 13, 24], [6, 25, 29], [11, 13, 20], [5, 29, 30], [13, 14, 15], [10, 17, 21], [7, 24, 25], [8, 29, 35], [12, 17, 25], [4, 51, 53], [19, 20, 37],[16, 17, 17], [17, 17, 30], [16, 25, 39], [13, 20, 21]]'); + testString: assert.deepEqual(heronianTriangle(testCases[3]), res[3]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md index 3474fe0a87..82b1c873dd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-figure-figure-sequences.english.md @@ -36,29 +36,29 @@ No maximum value for n should be assumed. ```yml tests: - text: ffr is a function. - testString: assert(typeof ffr === 'function', 'ffr is a function.'); + testString: assert(typeof ffr === 'function'); - text: ffs is a function. - testString: assert(typeof ffs === 'function', 'ffs is a function.'); + testString: assert(typeof ffs === 'function'); - text: ffr should return integer. - testString: assert(Number.isInteger(ffr(1)), 'ffr should return integer.'); + testString: assert(Number.isInteger(ffr(1))); - text: ffs should return integer. - testString: assert(Number.isInteger(ffs(1)), 'ffs should return integer.'); + testString: assert(Number.isInteger(ffs(1))); - text: ffr() should return 69 - testString: assert.equal(ffr(ffrParamRes[0][0]), ffrParamRes[0][1], 'ffr() should return 69'); + testString: assert.equal(ffr(ffrParamRes[0][0]), ffrParamRes[0][1]); - text: ffr() should return 1509 - testString: assert.equal(ffr(ffrParamRes[1][0]), ffrParamRes[1][1], 'ffr() should return 1509'); + testString: assert.equal(ffr(ffrParamRes[1][0]), ffrParamRes[1][1]); - text: ffr() should return 5764 - testString: assert.equal(ffr(ffrParamRes[2][0]), ffrParamRes[2][1], 'ffr() should return 5764'); + testString: assert.equal(ffr(ffrParamRes[2][0]), ffrParamRes[2][1]); - text: ffr() should return 526334 - testString: assert.equal(ffr(ffrParamRes[3][0]), ffrParamRes[3][1], 'ffr() should return 526334'); + testString: assert.equal(ffr(ffrParamRes[3][0]), ffrParamRes[3][1]); - text: ffs() should return 14 - testString: assert.equal(ffs(ffsParamRes[0][0]), ffsParamRes[0][1], 'ffs() should return 14'); + testString: assert.equal(ffs(ffsParamRes[0][0]), ffsParamRes[0][1]); - text: ffs() should return 59 - testString: assert.equal(ffs(ffsParamRes[1][0]), ffsParamRes[1][1], 'ffs() should return 59'); + testString: assert.equal(ffs(ffsParamRes[1][0]), ffsParamRes[1][1]); - text: ffs() should return 112 - testString: assert.equal(ffs(ffsParamRes[2][0]), ffsParamRes[2][1], 'ffs() should return 112'); + testString: assert.equal(ffs(ffsParamRes[2][0]), ffsParamRes[2][1]); - text: ffs() should return 1041 - testString: assert.equal(ffs(ffsParamRes[3][0]), ffsParamRes[3][1], 'ffs() should return 1041'); + testString: assert.equal(ffs(ffsParamRes[3][0]), ffsParamRes[3][1]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md index 762606ffb7..01a6c8ee1a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/hofstadter-q-sequence.english.md @@ -22,17 +22,17 @@ Implement the Hofstadter Q Sequence equation as a function. The function should ```yml tests: - text: hofstadterQ is a function. - testString: assert(typeof hofstadterQ === 'function', 'hofstadterQ is a function.'); + testString: assert(typeof hofstadterQ === 'function'); - text: hofstadterQ() should return integer - testString: assert(Number.isInteger(hofstadterQ(1000)), 'hofstadterQ() should return integer'); + testString: assert(Number.isInteger(hofstadterQ(1000))); - text: hofstadterQ(1000) should return 502 - testString: assert.equal(hofstadterQ(testCase[0]), res[0], 'hofstadterQ(1000) should return 502'); + testString: assert.equal(hofstadterQ(testCase[0]), res[0]); - text: hofstadterQ(1500) should return 755 - testString: assert.equal(hofstadterQ(testCase[1]), res[1], 'hofstadterQ(1500) should return 755'); + testString: assert.equal(hofstadterQ(testCase[1]), res[1]); - text: hofstadterQ(2000) should return 1005 - testString: assert.equal(hofstadterQ(testCase[2]), res[2], 'hofstadterQ(2000) should return 1005'); + testString: assert.equal(hofstadterQ(testCase[2]), res[2]); - text: hofstadterQ(2500) should return 1261 - testString: assert.equal(hofstadterQ(testCase[3]), res[3], 'hofstadterQ(2500) should return 1261'); + testString: assert.equal(hofstadterQ(testCase[3]), res[3]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md index 418a292b8e..58dfd58138 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/i-before-e-except-after-c.english.md @@ -30,21 +30,21 @@ Write a function that accepts a word and check if the word follows this rule. Th ```yml tests: - text: IBeforeExceptC should be a function. - testString: assert(typeof IBeforeExceptC=='function','IBeforeExceptC should be a function.'); + testString: assert(typeof IBeforeExceptC=='function'); - text: IBeforeExceptC("receive") should return a boolean. - testString: assert(typeof IBeforeExceptC("receive")=='boolean','IBeforeExceptC("receive") should return a boolean.'); + testString: assert(typeof IBeforeExceptC("receive")=='boolean'); - text: IBeforeExceptC("receive") should return true. - testString: assert.equal(IBeforeExceptC("receive"),true,'IBeforeExceptC("receive") should return true.'); + testString: assert.equal(IBeforeExceptC("receive"),true); - text: IBeforeExceptC("science") should return false. - testString: assert.equal(IBeforeExceptC("science"),false,'IBeforeExceptC("science") should return false.'); + testString: assert.equal(IBeforeExceptC("science"),false); - text: IBeforeExceptC("imperceivable") should return true. - testString: assert.equal(IBeforeExceptC("imperceivable"),true,'IBeforeExceptC("imperceivable") should return true.'); + testString: assert.equal(IBeforeExceptC("imperceivable"),true); - text: IBeforeExceptC("inconceivable") should return true. - testString: assert.equal(IBeforeExceptC("inconceivable"),true,'IBeforeExceptC("inconceivable") should return true.'); + testString: assert.equal(IBeforeExceptC("inconceivable"),true); - text: IBeforeExceptC("insufficient") should return false. - testString: assert.equal(IBeforeExceptC("insufficient"),false,'IBeforeExceptC("insufficient") should return false.'); + testString: assert.equal(IBeforeExceptC("insufficient"),false); - text: IBeforeExceptC("omniscient") should return false. - testString: assert.equal(IBeforeExceptC("omniscient"),false,'IBeforeExceptC("omniscient") should return false.'); + testString: assert.equal(IBeforeExceptC("omniscient"),false); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md index 76c449f81c..6f88c7fe49 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iban.english.md @@ -27,19 +27,19 @@ Write a function that takes IBAN string as parameter. If it is valid return true ```yml tests: - text: isValid should be a function. - testString: assert(typeof isValid=='function','isValid should be a function.'); + testString: assert(typeof isValid=='function'); - text: isValid("GB82 WEST 1234 5698 7654 32") should return a boolean. - testString: assert(typeof isValid('GB82 WEST 1234 5698 7654 32')=='boolean','isValid("GB82 WEST 1234 5698 7654 32") should return a boolean.'); + testString: assert(typeof isValid('GB82 WEST 1234 5698 7654 32')=='boolean'); - text: isValid("GB82 WEST 1234 5698 7654 32") should return true. - testString: assert.equal(isValid('GB82 WEST 1234 5698 7654 32'),true,'isValid("GB82 WEST 1234 5698 7654 32") should return true.'); + testString: assert.equal(isValid('GB82 WEST 1234 5698 7654 32'),true); - text: isValid("GB82 WEST 1.34 5698 7654 32") should return false. - testString: assert.equal(isValid('GB82 WEST 1.34 5698 7654 32'),false,'isValid("GB82 WEST 1.34 5698 7654 32") should return false.'); + testString: assert.equal(isValid('GB82 WEST 1.34 5698 7654 32'),false); - text: isValid("GB82 WEST 1234 5698 7654 325") should return false. - testString: assert.equal(isValid('GB82 WEST 1234 5698 7654 325'),false,'isValid("GB82 WEST 1234 5698 7654 325") should return false.'); + testString: assert.equal(isValid('GB82 WEST 1234 5698 7654 325'),false); - text: isValid("GB82 TEST 1234 5698 7654 32") should return false. - testString: assert.equal(isValid('GB82 TEST 1234 5698 7654 32'),false,'isValid("GB82 TEST 1234 5698 7654 32") should return false.'); + testString: assert.equal(isValid('GB82 TEST 1234 5698 7654 32'),false); - text: isValid("SA03 8000 0000 6080 1016 7519") should return true. - testString: assert.equal(isValid('SA03 8000 0000 6080 1016 7519'),true,'isValid("SA03 8000 0000 6080 1016 7519") should return true.'); + testString: assert.equal(isValid('SA03 8000 0000 6080 1016 7519'),true); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/identity-matrix.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/identity-matrix.english.md index 0fb7e697cf..0735aed00a 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/identity-matrix.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/identity-matrix.english.md @@ -23,9 +23,9 @@ Write a function that takes a number n as a parameter and returns t ```yml tests: - text: idMatrix should be a function. - testString: assert(typeof idMatrix=='function','idMatrix should be a function.'); + testString: assert(typeof idMatrix=='function'); - text: idMatrix(1) should return an array. - testString: assert(Array.isArray(idMatrix(1)),'idMatrix(1) should return an array.'); + testString: assert(Array.isArray(idMatrix(1))); - text: idMatrix(1) should return [ [ 1 ] ]. testString: assert.deepEqual(idMatrix(1),results[0]); - text: idMatrix(2) should return [ [ 1, 0 ], [ 0, 1 ] ]. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md index bdd98b6746..a9d6f0e8a8 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/iterated-digits-squaring.english.md @@ -24,21 +24,21 @@ Write a function that takes a number as a parameter and returns 1 or 89 after pe ```yml tests: - text: iteratedSquare should be a function. - testString: assert(typeof iteratedSquare=='function','iteratedSquare should be a function.'); + testString: assert(typeof iteratedSquare=='function'); - text: iteratedSquare(4) should return a number. - testString: assert(typeof iteratedSquare(4)=='number','iteratedSquare(4) should return a number.'); + testString: assert(typeof iteratedSquare(4)=='number'); - text: iteratedSquare(4) should return 89. - testString: assert.equal(iteratedSquare(4),89,'iteratedSquare(4) should return 89.'); + testString: assert.equal(iteratedSquare(4),89); - text: iteratedSquare(7) should return 1. - testString: assert.equal(iteratedSquare(7),1,'iteratedSquare(7) should return 1.'); + testString: assert.equal(iteratedSquare(7),1); - text: iteratedSquare(15) should return 89. - testString: assert.equal(iteratedSquare(15),89,'iteratedSquare(15) should return 89.'); + testString: assert.equal(iteratedSquare(15),89); - text: iteratedSquare(20) should return 89. - testString: assert.equal(iteratedSquare(20),89,'iteratedSquare(20) should return 89.'); + testString: assert.equal(iteratedSquare(20),89); - text: iteratedSquare(70) should return 1. - testString: assert.equal(iteratedSquare(70),1,'iteratedSquare(70) should return 1.'); + testString: assert.equal(iteratedSquare(70),1); - text: iteratedSquare(100) should return 1. - testString: assert.equal(iteratedSquare(100),1,'iteratedSquare(100) should return 1.'); + testString: assert.equal(iteratedSquare(100),1); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md index 6abd8d8f1d..308fa680d4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jaro-distance.english.md @@ -39,19 +39,19 @@ Write a function a that takes two strings as parameters and returns the associat ```yml tests: - text: jaro should be a function. - testString: assert(typeof jaro=='function','jaro should be a function.'); + testString: assert(typeof jaro=='function'); - text: jaro("MARTHA", "MARHTA") should return a number. - testString: assert(typeof jaro('MARTHA', 'MARHTA')=='number','jaro() should return a number.'); + testString: assert(typeof jaro('MARTHA', 'MARHTA')=='number'); - text: jaro("MARTHA", "MARHTA") should return 0.9444444444444445. - testString: assert.equal(jaro('MARTHA', 'MARHTA'), 0.9444444444444445,'jaro("MARTHA", "MARHTA") should return 0.9444444444444445.'); + testString: assert.equal(jaro('MARTHA', 'MARHTA'), 0.9444444444444445); - text: jaro("DIXON", "DICKSONX") should return 0.7666666666666666. - testString: assert.equal(jaro('DIXON', 'DICKSONX'), 0.7666666666666666,'jaro("DIXON", "DICKSONX") should return 0.7666666666666666.'); + testString: assert.equal(jaro('DIXON', 'DICKSONX'), 0.7666666666666666); - text: jaro("JELLYFISH", "SMELLYFISH") should return 0.8962962962962964. - testString: assert.equal(jaro('JELLYFISH', 'SMELLYFISH'), 0.8962962962962964,'jaro("JELLYFISH", "SMELLYFISH") should return 0.8962962962962964.'); + testString: assert.equal(jaro('JELLYFISH', 'SMELLYFISH'), 0.8962962962962964); - text: jaro("HELLOS", "CHELLO") should return 0.888888888888889. - testString: assert.equal(jaro('HELLOS', 'CHELLO'), 0.888888888888889,'jaro("HELLOS", "CHELLO") should return 0.888888888888889.'); + testString: assert.equal(jaro('HELLOS', 'CHELLO'), 0.888888888888889); - text: jaro("ABCD", "BCDA") should return 0.8333333333333334. - testString: assert.equal(jaro('ABCD', 'BCDA'), 0.8333333333333334,'jaro("ABCD", "BCDA") should return 0.8333333333333334.'); + testString: assert.equal(jaro('ABCD', 'BCDA'), 0.8333333333333334); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md index ff11fdac00..6c00bee21f 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/jortsort.english.md @@ -21,21 +21,21 @@ jortSort is a function that takes a single array of comparable objects as its ar ```yml tests: - text: jortsort should be a function. - testString: assert(typeof jortsort=='function','jortsort should be a function.'); + testString: assert(typeof jortsort=='function'); - text: jortsort([1,2,3,4,5]) should return a boolean. - testString: assert(typeof jortsort([1,2,3,4,5])=='boolean','jortsort([1,2,3,4,5]) should return a boolean.'); + testString: assert(typeof jortsort([1,2,3,4,5])=='boolean'); - text: jortsort([1,2,3,4,5]) should return true. - testString: assert.equal(jortsort([1,2,3,4,5]),true,'jortsort([1,2,3,4,5]) should return true.'); + testString: assert.equal(jortsort([1,2,3,4,5]),true); - text: jortsort([1,2,13,4,5]) should return false. - testString: assert.equal(jortsort([1,2,13,4,5]),false,'jortsort([1,2,13,4,5]) should return false.'); + testString: assert.equal(jortsort([1,2,13,4,5]),false); - text: jortsort([12,4,51,2,4]) should return false. - testString: assert.equal(jortsort([12,4,51,2,4]),false,'jortsort([12,4,51,2,4]) should return false.'); + testString: assert.equal(jortsort([12,4,51,2,4]),false); - text: jortsort([1,2]) should return true. - testString: assert.equal(jortsort([1,2]),true,'jortsort([1,2]) should return true.'); + testString: assert.equal(jortsort([1,2]),true); - text: jortsort([5,4,3,2,1]) should return false. - testString: assert.equal(jortsort([5,4,3,2,1]),false,'jortsort([5,4,3,2,1]) should return false.'); + testString: assert.equal(jortsort([5,4,3,2,1]),false); - text: jortsort([1,1,1,1,1]) should return true. - testString: assert.equal(jortsort([1,1,1,1,1]),true,'jortsort([1,1,1,1,1]) should return true.'); + testString: assert.equal(jortsort([1,1,1,1,1]),true); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md index a92be3036c..dd072a65ac 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/josephus-problem.english.md @@ -27,19 +27,19 @@ Write a function that takes the initial number of prisoners and 'k' as parameter ```yml tests: - text: josephus should be a function. - testString: assert(typeof josephus=='function','josephus should be a function.'); + testString: assert(typeof josephus=='function'); - text: josephus(30,3) should return a number. - testString: assert(typeof josephus(30,3)=='number','josephus(30,3) should return a number.'); + testString: assert(typeof josephus(30,3)=='number'); - text: josephus(30,3) should return 29. - testString: assert.equal(josephus(30,3),29,'josephus(30,3) should return 29.'); + testString: assert.equal(josephus(30,3),29); - text: josephus(30,5) should return 3. - testString: assert.equal(josephus(30,5),3,'josephus(30,5) should return 3.'); + testString: assert.equal(josephus(30,5),3); - text: josephus(20,2) should return 9. - testString: assert.equal(josephus(20,2),9,'josephus(20,2) should return 9.'); + testString: assert.equal(josephus(20,2),9); - text: josephus(17,6) should return 2. - testString: assert.equal(josephus(17,6),2,'josephus(17,6) should return 2.'); + testString: assert.equal(josephus(17,6),2); - text: josephus(29,4) should return 2. - testString: assert.equal(josephus(29,4),2,'josephus(29,4) should return 2.'); + testString: assert.equal(josephus(29,4),2); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md index 205b241cb1..3ea6e62954 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/s-expressions.english.md @@ -32,11 +32,11 @@ and turn it into a native data structure. (See the parseSexpr('(data1 data2 data3)') should return ['data1', 'data2', 'data3']"); + testString: assert.deepEqual(parseSexpr(simpleSExpr), simpleSolution); - text: parseSexpr('(data1 data2 data3)') should return an array with 3 elements. - testString: assert.deepEqual(parseSexpr(basicSExpr), basicSolution, "parseSexpr('(data1 data2 data3)') should return an array with 3 elements"); + testString: assert.deepEqual(parseSexpr(basicSExpr), basicSolution); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md index 290b4bda90..bebeed6e10 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sailors-coconuts-and-a-monkey-problem.english.md @@ -32,13 +32,13 @@ Of course the tale is told in a world where the collection of any amount of coco ```yml tests: - text: splitCoconuts is a function. - testString: assert(typeof splitCoconuts === 'function', 'splitCoconuts is a function.'); + testString: assert(typeof splitCoconuts === 'function'); - text: splitCoconuts(5) should return 3121. - testString: assert(splitCoconuts(5) === 3121, 'splitCoconuts(5) should return 3121.'); + testString: assert(splitCoconuts(5) === 3121); - text: splitCoconuts(6) should return 233275. - testString: assert(splitCoconuts(6) === 233275, 'splitCoconuts(6) should return 233275.'); + testString: assert(splitCoconuts(6) === 233275); - text: splitCoconuts(7) should return 823537. - testString: assert(splitCoconuts(7) === 823537, 'splitCoconuts(7) should return 823537.'); + testString: assert(splitCoconuts(7) === 823537); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md index 4c368ffd9e..599ddf81d3 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sedols.english.md @@ -36,7 +36,7 @@ Check that each input is correctly formed, especially with respect to valid char ```yml tests: - text: sedol is a function. - testString: assert(typeof sedol === 'function', 'sedol is a function.'); + testString: assert(typeof sedol === 'function'); - text: sedol('a') should return null. testString: assert(sedol('a') === null); - text: sedol('710889') should return '7108899'. diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.english.md index 1c46ae9b0a..5be355cc3b 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/sort-an-array-of-composite-structures.english.md @@ -20,15 +20,15 @@ Write a function that takes an array of objects as a parameter. The function sho ```yml tests: - text: sortByKey should be a function. - testString: assert(typeof sortByKey == 'function', 'sortByKey should be a function.'); + testString: assert(typeof sortByKey == 'function'); - text: 'sortByKey([{key: 3, value: "foo"}, {key: 2, value: "bar"}, {key: 4, value: "baz"}, {key: 1, value: 42}, {key: 5, value: "another string"}]) should return an array.' - testString: assert(Array.isArray(sortByKey([{key:3, value:"foo"}, {key:2, value:"bar"}, {key:4, value:"baz"}, {key:1, value:42}, {key:5, value:"another string"}])), 'sortByKey([{key:3, value:"foo"}, {key:2, value:"bar"}, {key:4, value:"baz"}, {key:1, value:42}, {key:5, value:"another string"}]) should return an array.'); + testString: assert(Array.isArray(sortByKey([{key:3, value:"foo"}, {key:2, value:"bar"}, {key:4, value:"baz"}, {key:1, value:42}, {key:5, value:"another string"}]))); - text: 'sortByKey([{key: 3, value: "foo"}, {key: 2, value: "bar"}, {key: 4, value: "baz"}, {key: 1, value: 42}, {key: 5, value: "another string"}]) should return [{key: 1, value: 42}, {key: 2, value: "bar"}, {key: 3, value: "foo"}, {key: 4, value: "baz"}, {key: 5, value: "another string"}].' - testString: assert.deepEqual(sortByKey([{key:3, value:"foo"}, {key:2, value:"bar"}, {key:4, value:"baz"}, {key:1, value:42}, {key:5, value:"another string"}]), [{key:1, value:42}, {key:2, value:"bar"}, {key:3, value:"foo"}, {key:4, value:"baz"}, {key:5, value:"another string"}], 'sortByKey([{key:3, value:"foo"}, {key:2, value:"bar"}, {key:4, value:"baz"}, {key:1, value:42}, {key:5, value:"another string"}]) should return [{key:1, value:42}, {key:2, value:"bar"}, {key:3, value:"foo"}, {key:4, value:"baz"}, {key:5, value:"another string"}].'); + testString: assert.deepEqual(sortByKey([{key:3, value:"foo"}, {key:2, value:"bar"}, {key:4, value:"baz"}, {key:1, value:42}, {key:5, value:"another string"}]), [{key:1, value:42}, {key:2, value:"bar"}, {key:3, value:"foo"}, {key:4, value:"baz"}, {key:5, value:"another string"}]); - text: 'sortByKey([{key: 3, name: "Joe"}, {key: 4, name: "Bill"}, {key: 20, name: "Alice"}, {key: 5, name: "Harry"}]) should return [{key: 3, name: "Joe"}, {key: 4, name: "Bill"}, {key: 5, name: "Harry"}, {key: 20, name: "Alice"}].' - testString: assert.deepEqual(sortByKey([{key:3, name:"Joe"}, {key:4, name:"Bill"}, {key:20, name:"Alice"}, {key:5, name:"Harry"}]), [{key:3, name:"Joe"}, {key:4, name:"Bill"}, {key:5, name:"Harry"}, {key:20, name:"Alice"}], 'sortByKey([{key:3, name:"Joe"}, {key:4, name:"Bill"}, {key:20, name:"Alice"}, {key:5, name:"Harry"}]) should return [{key:3, name:"Joe"}, {key:4, name:"Bill"}, {key:5, name:"Harry"}, {key:20, name:"Alice"}].'); + testString: assert.deepEqual(sortByKey([{key:3, name:"Joe"}, {key:4, name:"Bill"}, {key:20, name:"Alice"}, {key:5, name:"Harry"}]), [{key:3, name:"Joe"}, {key:4, name:"Bill"}, {key:5, name:"Harry"}, {key:20, name:"Alice"}]); - text: 'sortByKey([{key: 2341, name: "Adam"}, {key: 122, name: "Bernie"}, {key: 19, name: "David"}, {key: 5531, name: "Joe"}, {key: 1234, name: "Walter"}]) should return [{key: 19, name: "David"}, {key: 122, name: "Bernie"}, {key: 1234, name: "Walter"}, {key: 2341, name: "Adam"}, {key: 5531, name: "Joe"}].' - testString: assert.deepEqual(sortByKey([{key:2341, name:"Adam"}, {key:122, name:"Bernie"}, {key:19, name:"David"}, {key:5531, name:"Joe"}, {key:1234, name:"Walter"}]), [{key:19, name:"David"}, {key:122, name:"Bernie"}, {key:1234, name:"Walter"}, {key:2341, name:"Adam"}, {key:5531, name:"Joe"}], 'sortByKey([{key:2341, name:"Adam"}, {key:122, name:"Bernie"}, {key:19, name:"David"}, {key:5531, name:"Joe"}, {key:1234, name:"Walter"}]) should return [{key:19, name:"David"}, {key:122, name:"Bernie"}, {key:1234, name:"Walter"}, {key:2341, name:"Adam"}, {key:5531, name:"Joe"}].'); + testString: assert.deepEqual(sortByKey([{key:2341, name:"Adam"}, {key:122, name:"Bernie"}, {key:19, name:"David"}, {key:5531, name:"Joe"}, {key:1234, name:"Walter"}]), [{key:19, name:"David"}, {key:122, name:"Bernie"}, {key:1234, name:"Walter"}, {key:2341, name:"Adam"}, {key:5531, name:"Joe"}]); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md index 9a4ed0cb28..0789faaca4 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/taxicab-numbers.english.md @@ -35,17 +35,17 @@ Write a function that returns the lowest n taxicab numbers. For eac ```yml tests: - text: taxicabNumbers is a function. - testString: assert(typeof taxicabNumbers === 'function', 'taxicabNumbers is a function.'); + testString: assert(typeof taxicabNumbers === 'function'); - text: taxicabNumbers should return an array. - testString: assert(typeof taxicabNumbers(2) === 'object', 'taxicabNumbers should return an array.'); + testString: assert(typeof taxicabNumbers(2) === 'object'); - text: taxicabNumbers should return an array of numbers. - testString: assert(typeof taxicabNumbers(100)[0] === 'number', 'taxicabNumbers should return an array of numbers.'); + testString: assert(typeof taxicabNumbers(100)[0] === 'number'); - text: taxicabNumbers(4) must return [1729, 4104, 13832, 20683]. - testString: assert.deepEqual(taxicabNumbers(4), res4, 'taxicabNumbers(4) must return [1729, 4104, 13832, 20683].'); + testString: assert.deepEqual(taxicabNumbers(4), res4); - text: taxicabNumbers(25) should return [1729, 4104, 13832, 20683, 32832, 39312, 40033, 46683, 64232, 65728, 110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656, 314496, 320264, 327763, 373464, 402597] - testString: assert.deepEqual(taxicabNumbers(25), res25, 'taxicabNumbers(25) should return [1729, 4104, 13832, 20683, 32832, 39312, 40033, 46683, 64232, 65728, 110656, 110808, 134379, 149389, 165464, 171288, 195841, 216027, 216125, 262656, 314496, 320264, 327763, 373464, 402597]'); + testString: assert.deepEqual(taxicabNumbers(25), res25); - text: taxicabNumbers(39) resulting numbers from 20 - 29 should be [314496,320264,327763,373464,402597,439101,443889,513000,513856]. - testString: assert.deepEqual(taxicabNumbers(39).slice(20, 29), res39From20To29, 'taxicabNumbers(39) resulting numbers from 20 - 29 should be [314496,320264,327763,373464,402597,439101,443889,513000,513856].'); + testString: assert.deepEqual(taxicabNumbers(39).slice(20, 29), res39From20To29); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md index e3adea23c8..e943c125f1 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/tokenize-a-string-with-escaping.english.md @@ -45,13 +45,13 @@ and using | as a separator and ^ as escape character, ```yml tests: - text: tokenize is a function. - testString: assert(typeof tokenize === 'function', 'tokenize is a function.'); + testString: assert(typeof tokenize === 'function'); - text: tokenize should return an array. - testString: assert(typeof tokenize('a', 'b', 'c') === 'object', 'tokenize should return an array.'); + testString: assert(typeof tokenize('a', 'b', 'c') === 'object'); - text: tokenize('one^|uno||three^^^^|four^^^|^cuatro|', '|', '^') should return ['one|uno', '', 'three^^', 'four^|cuatro', ''] - testString: assert.deepEqual(tokenize(testStr1, '|', '^'), res1, "tokenize('one^|uno||three^^^^|four^^^|^cuatro|', '|', '^') should return ['one|uno', '', 'three^^', 'four^|cuatro', '']"); + testString: assert.deepEqual(tokenize(testStr1, '|', '^'), res1); - text: tokenize('a@&bcd&ef&&@@hi', '&', '@') should return ['a&bcd', 'ef', '', '@hi'] - testString: assert.deepEqual(tokenize(testStr2, '&', '@'), res2, 'tokenize("a@&bcd&ef&&@@hi", "&", "@") should return ["a&bcd", "ef", "", "@hi"]'); + testString: assert.deepEqual(tokenize(testStr2, '&', '@'), res2); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md index 1f2f84c31c..3c0be116cd 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/top-rank-per-group.english.md @@ -52,19 +52,19 @@ one could rank the top-rated movie in each genre by calling ```yml tests: - text: topRankPerGroup is a function. - testString: assert(typeof topRankPerGroup === 'function', 'topRankPerGroup is a function.'); + testString: assert(typeof topRankPerGroup === 'function'); - text: topRankPerGroup returns undefined on negative n values. - testString: assert(typeof topRankPerGroup(-1, []) === 'undefined', 'topRankPerGroup returns undefined on negative n values.'); + testString: assert(typeof topRankPerGroup(-1, []) === 'undefined'); - text: First department must be D050 - testString: assert.equal(res1[0][0].dept, 'D050', 'First department must be D050'); + testString: assert.equal(res1[0][0].dept, 'D050'); - text: First department must be D050 - testString: assert.equal(res1[0][1].salary, 21900, 'First department must be D050'); + testString: assert.equal(res1[0][1].salary, 21900); - text: The last department must be D202 - testString: assert.equal(res1[3][3].dept, 'D202', 'The last department must be D202'); + testString: assert.equal(res1[3][3].dept, 'D202'); - text: topRankPerGroup(1, ...) must return only top ranking result per group. - testString: assert.equal(res2[2].length, 1, 'topRankPerGroup(1, ...) must return only top ranking result per group.'); + testString: assert.equal(res2[2].length, 1); - text: topRankPerGroup(1, ...) must return only top ranking result per group. - testString: assert.equal(res3[2][1].name, 'Maze Runner', 'topRankPerGroup(1, ...) must return only top ranking result per group.'); + testString: assert.equal(res3[2][1].name, 'Maze Runner'); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md index bdb6d435cb..976ecce571 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/topological-sort.english.md @@ -57,15 +57,15 @@ There are two popular algorithms for topological sorting: ```yml tests: - text: topologicalSort is a function. - testString: assert(typeof topologicalSort === 'function', 'topologicalSort is a function.'); + testString: assert(typeof topologicalSort === 'function'); - text: topologicalSort must return correct library order.. - testString: assert.deepEqual(topologicalSort(libsSimple), ['bbb', 'aaa'], 'topologicalSort must return correct library order..'); + testString: assert.deepEqual(topologicalSort(libsSimple), ['bbb', 'aaa']); - text: topologicalSort must return correct library order.. - testString: assert.deepEqual(topologicalSort(libsVHDL), solutionVHDL, 'topologicalSort must return correct library order..'); + testString: assert.deepEqual(topologicalSort(libsVHDL), solutionVHDL); - text: topologicalSort must return correct library order.. - testString: assert.deepEqual(topologicalSort(libsCustom), solutionCustom, 'topologicalSort must return correct library order..'); + testString: assert.deepEqual(topologicalSort(libsCustom), solutionCustom); - text: topologicalSort must ignore unorderable dependencies.. - testString: assert.deepEqual(topologicalSort(libsUnorderable), solutionUnorderable, 'topologicalSort must ignore unorderable dependencies..'); + testString: assert.deepEqual(topologicalSort(libsUnorderable), solutionUnorderable); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md index fe5fbddfeb..cc32d59f26 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/towers-of-hanoi.english.md @@ -23,15 +23,15 @@ For example, the array [['A', 'C'], ['B', 'A']] indicates that the ```yml tests: - text: towerOfHanoi is a function. - testString: assert(typeof towerOfHanoi === 'function', 'towerOfHanoi is a function.'); + testString: assert(typeof towerOfHanoi === 'function'); - text: towerOfHanoi(3, ...) should return 7 moves. - testString: assert(res3.length === 7, 'towerOfHanoi(3, ...) should return 7 moves.'); + testString: assert(res3.length === 7); - text: towerOfHanoi(3, 'A', 'B', 'C') should return [['A','B'], ['A','C'], ['B','C'], ['A','B'], ['C','A'], ['C','B'], ['A','B']]. - testString: assert.deepEqual(towerOfHanoi(3, 'A', 'B', 'C'), res3Moves, "towerOfHanoi(3, 'A', 'B', 'C') should return [['A','B'], ['A','C'], ['B','C'], ['A','B'], ['C','A'], ['C','B'], ['A','B']]."); + testString: assert.deepEqual(towerOfHanoi(3, 'A', 'B', 'C'), res3Moves); - text: towerOfHanoi(5, "X", "Y", "Z") 10th move should be Y -> X. - testString: assert.deepEqual(res5[9], ['Y', 'X'], 'towerOfHanoi(5, "X", "Y", "Z") 10th move should be Y -> X.'); + testString: assert.deepEqual(res5[9], ['Y', 'X']); - text: towerOfHanoi(7, 'A', 'B', 'C') first ten moves are [['A','B'], ['A','C'], ['B','C'], ['A','B'], ['C','A'], ['C','B'], ['A','B'], ['A','C'], ['B','C'], ['B','A']] - testString: assert.deepEqual(towerOfHanoi(7, 'A', 'B', 'C').slice(0, 10), res7First10Moves, "towerOfHanoi(7, 'A', 'B', 'C') first ten moves are [['A','B'], ['A','C'], ['B','C'], ['A','B'], ['C','A'], ['C','B'], ['A','B'], ['A','C'], ['B','C'], ['B','A']]."); + testString: assert.deepEqual(towerOfHanoi(7, 'A', 'B', 'C').slice(0, 10), res7First10Moves); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md index 623a7d2e7a..86d98effed 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-cross-product.english.md @@ -22,11 +22,11 @@ Write a function that takes two vectors (arrays) as input and computes their cro ```yml tests: - text: dotProduct must be a function - testString: assert.equal(typeof crossProduct, 'function', 'dotProduct must be a function'); + testString: assert.equal(typeof crossProduct, 'function'); - text: dotProduct() must return null - testString: assert.equal(crossProduct(), null, 'dotProduct() must return null'); + testString: assert.equal(crossProduct(), null); - text: crossProduct([1, 2, 3], [4, 5, 6]) must return [-3, 6, -3]. - testString: assert.deepEqual(res12, exp12, 'crossProduct([1, 2, 3], [4, 5, 6]) must return [-3, 6, -3].'); + testString: assert.deepEqual(res12, exp12); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md index 47daca336b..35eaf5a2b0 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/vector-dot-product.english.md @@ -22,17 +22,17 @@ Write a function that takes any numbers of vectors (arrays) as input and compute ```yml tests: - text: dotProduct must be a function - testString: assert.equal(typeof dotProduct, 'function', 'dotProduct must be a function'); + testString: assert.equal(typeof dotProduct, 'function'); - text: dotProduct() must return null - testString: assert.equal(dotProduct(), null, 'dotProduct() must return null'); + testString: assert.equal(dotProduct(), null); - text: dotProduct([[1], [1]]) must return 1. - testString: assert.equal(dotProduct([1], [1]), 1, 'dotProduct([[1], [1]]) must return 1.'); + testString: assert.equal(dotProduct([1], [1]), 1); - text: dotProduct([[1], [1, 2]]) must return null. - testString: assert.equal(dotProduct([1], [1, 2]), null, 'dotProduct([[1], [1, 2]]) must return null.'); + testString: assert.equal(dotProduct([1], [1, 2]), null); - text: dotProduct([1, 3, -5], [4, -2, -1]) must return 3. - testString: assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3, 'dotProduct([1, 3, -5], [4, -2, -1]) must return 3.'); + testString: assert.equal(dotProduct([1, 3, -5], [4, -2, -1]), 3); - text: dotProduct(...nVectors) should return 156000 - testString: assert.equal(dotProduct([ 0, 1, 2, 3, 4 ], [ 0, 2, 4, 6, 8 ], [ 0, 3, 6, 9, 12 ], [ 0, 4, 8, 12, 16 ], [ 0, 5, 10, 15, 20 ]), 156000, 'dotProduct(...nVectors) should return 156000'); + testString: assert.equal(dotProduct([ 0, 1, 2, 3, 4 ], [ 0, 2, 4, 6, 8 ], [ 0, 3, 6, 9, 12 ], [ 0, 4, 8, 12, 16 ], [ 0, 5, 10, 15, 20 ]), 156000); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md index dc6ad6c1ff..294f3c9a93 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/word-wrap.english.md @@ -28,17 +28,17 @@ than a simple minimum length algorithm. ```yml tests: - text: wrap must be a function. - testString: assert.equal(typeof wrap, 'function', 'wrap must be a function.'); + testString: assert.equal(typeof wrap, 'function'); - text: wrap must return a string. - testString: assert.equal(typeof wrap('abc', 10), 'string', 'wrap must return a string.'); + testString: assert.equal(typeof wrap('abc', 10), 'string'); - text: wrap(80) must return 4 lines. - testString: assert(wrapped80.split('\n').length === 4, 'wrap(80) must return 4 lines.'); + testString: assert(wrapped80.split('\n').length === 4); - text: Your wrap function should return our expected text - testString: assert.equal(wrapped80.split('\n')[0], firstRow80, 'Your wrap function should return our expected text'); + testString: assert.equal(wrapped80.split('\n')[0], firstRow80); - text: wrap(42) must return 7 lines. - testString: assert(wrapped42.split('\n').length === 7, 'wrap(42) must return 7 lines.'); + testString: assert(wrapped42.split('\n').length === 7); - text: Your wrap function should return our expected text - testString: assert.equal(wrapped42.split('\n')[0], firstRow42, 'Your wrap function should return our expected text'); + testString: assert.equal(wrapped42.split('\n')[0], firstRow42); ``` diff --git a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md index 9007477323..8c420c498c 100644 --- a/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md +++ b/curriculum/challenges/english/08-coding-interview-prep/rosetta-code/y-combinator.english.md @@ -27,17 +27,17 @@ Define the stateless Y combinator function and use it to compute