From 90bac7239d2b5b41b45359bad0686ca85f610968 Mon Sep 17 00:00:00 2001 From: zenocross <69914719+zenocross@users.noreply.github.com> Date: Sun, 8 Jun 2025 04:00:49 +0800 Subject: [PATCH] chore: update tests to use specific asserts in project euler problems 11-20 (#60763) --- .../problem-11-largest-product-in-a-grid.md | 2 +- .../problem-12-highly-divisible-triangular-number.md | 2 +- .../project-euler-problems-1-to-100/problem-13-large-sum.md | 2 +- .../problem-14-longest-collatz-sequence.md | 2 +- .../project-euler-problems-1-to-100/problem-15-lattice-paths.md | 2 +- .../problem-16-power-digit-sum.md | 2 +- .../problem-17-number-letter-counts.md | 2 +- .../problem-18-maximum-path-sum-i.md | 2 +- .../problem-19-counting-sundays.md | 2 +- .../problem-20-factorial-digit-sum.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-11-largest-product-in-a-grid.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-11-largest-product-in-a-grid.md index 507d9a56ea8..59c66a2aab2 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-11-largest-product-in-a-grid.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-11-largest-product-in-a-grid.md @@ -42,7 +42,7 @@ What is the greatest product of four adjacent numbers in the same direction (up, `largestGridProduct(testGrid)` should return a number. ```js -assert(typeof largestGridProduct(testGrid) === 'number'); +assert.isNumber(largestGridProduct(testGrid)); ``` `largestGridProduct(testGrid)` should return 14169081. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-12-highly-divisible-triangular-number.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-12-highly-divisible-triangular-number.md index 2fa68e80276..b6dbf1eca2a 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-12-highly-divisible-triangular-number.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-12-highly-divisible-triangular-number.md @@ -31,7 +31,7 @@ What is the value of the first triangle number to have over `n` divisors? `divisibleTriangleNumber(5)` should return a number. ```js -assert(typeof divisibleTriangleNumber(5) === 'number'); +assert.isNumber(divisibleTriangleNumber(5)); ``` `divisibleTriangleNumber(5)` should return 28. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-13-large-sum.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-13-large-sum.md index 7e4db74fcb7..f2635a545d8 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-13-large-sum.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-13-large-sum.md @@ -118,7 +118,7 @@ Work out the first ten digits of the sum of the following one-hundred 50-digit n `largeSum(testNums)` should return a number. ```js -assert(typeof largeSum(testNums) === 'number'); +assert.isNumber(largeSum(testNums)); ``` `largeSum(testNums)` should return 8348422521. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-14-longest-collatz-sequence.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-14-longest-collatz-sequence.md index cac70d3bb29..8e1c1c46d22 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-14-longest-collatz-sequence.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-14-longest-collatz-sequence.md @@ -29,7 +29,7 @@ Which starting number, under the given `limit`, produces the longest chain? `longestCollatzSequence(14)` should return a number. ```js -assert(typeof longestCollatzSequence(14) === 'number'); +assert.isNumber(longestCollatzSequence(14)); ``` `longestCollatzSequence(14)` should return 9. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-15-lattice-paths.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-15-lattice-paths.md index 0d52e4f4320..d57a91318de 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-15-lattice-paths.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-15-lattice-paths.md @@ -19,7 +19,7 @@ How many such routes are there through a given `gridSize`? `latticePaths(4)` should return a number. ```js -assert(typeof latticePaths(4) === 'number'); +assert.isNumber(latticePaths(4)); ``` `latticePaths(4)` should return 70. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-16-power-digit-sum.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-16-power-digit-sum.md index 8ef1c137f88..c6e82dd4a06 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-16-power-digit-sum.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-16-power-digit-sum.md @@ -17,7 +17,7 @@ What is the sum of the digits of the number 2exponent? `powerDigitSum(15)` should return a number. ```js -assert(typeof powerDigitSum(15) === 'number'); +assert.isNumber(powerDigitSum(15)); ``` `powerDigitSum(15)` should return 26. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-17-number-letter-counts.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-17-number-letter-counts.md index c64e9f073f6..9275f3320de 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-17-number-letter-counts.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-17-number-letter-counts.md @@ -19,7 +19,7 @@ If all the numbers from 1 to given `limit` inclusive were written out in words, `numberLetterCounts(5)` should return a number. ```js -assert(typeof numberLetterCounts(5) === 'number'); +assert.isNumber(numberLetterCounts(5)); ``` `numberLetterCounts(5)` should return 19. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-18-maximum-path-sum-i.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-18-maximum-path-sum-i.md index 5658c421a53..9560ee6f9e3 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-18-maximum-path-sum-i.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-18-maximum-path-sum-i.md @@ -44,7 +44,7 @@ Find the maximum total from top to bottom of the triangle below: `maximumPathSumI([[3, 0, 0, 0], [7, 4, 0, 0],[2, 4, 6, 0],[8, 5, 9, 3]])` should return a number. ```js -assert(typeof maximumPathSumI(_testTriangle) === 'number'); +assert.isNumber(maximumPathSumI(_testTriangle)); ``` `maximumPathSumI([[3, 0, 0, 0], [7, 4, 0, 0],[2, 4, 6, 0],[8, 5, 9, 3]])` should return 23. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-19-counting-sundays.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-19-counting-sundays.md index 5a3e24cc431..4392cb4b58c 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-19-counting-sundays.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-19-counting-sundays.md @@ -23,7 +23,7 @@ How many Sundays fell on the first of the month during the twentieth century (1 `countingSundays(1943, 1946)` should return a number. ```js -assert(typeof countingSundays(1943, 1946) === 'number'); +assert.isNumber(countingSundays(1943, 1946)); ``` `countingSundays(1943, 1946)` should return 6. diff --git a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-20-factorial-digit-sum.md b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-20-factorial-digit-sum.md index a109ff5f9b2..bee70af1756 100644 --- a/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-20-factorial-digit-sum.md +++ b/curriculum/challenges/english/18-project-euler/project-euler-problems-1-to-100/problem-20-factorial-digit-sum.md @@ -20,7 +20,7 @@ Find the sum of the digits `n`! `sumFactorialDigits(10)` should return a number. ```js -assert(typeof sumFactorialDigits(10) === 'number'); +assert.isNumber(sumFactorialDigits(10)); ``` `sumFactorialDigits(10)` should return 27.