feat(seed): Added more assertion for Project Euler problem twe (#15887)

This commit is contained in:
Alvin Kristanto
2017-10-25 13:03:42 +07:00
committed by Quincy Larson
parent ada67f8649
commit 739f1879a2

View File

@ -842,17 +842,20 @@
"type": "bonfire", "type": "bonfire",
"title": "Problem 27: Quadratic primes", "title": "Problem 27: Quadratic primes",
"tests": [ "tests": [
"assert.strictEqual(euler27(), -59231, 'message: <code>euler27()</code> should return -59231.');" "assert(quadraticPrimes(200) == -4925, 'message: <code>quadraticPrimes(200)</code> should return -4925.');",
"assert(quadraticPrimes(500) == -18901, 'message: <code>quadraticPrimes(500)</code> should return -18901.');",
"assert(quadraticPrimes(800) == -43835, 'message: <code>quadraticPrimes(800)</code> should return -43835.');",
"assert(quadraticPrimes(1000) == -59231, 'message: <code>quadraticPrimes(1000)</code> should return -59231.');"
], ],
"solutions": [], "solutions": [],
"translations": {}, "translations": {},
"challengeSeed": [ "challengeSeed": [
"function euler27() {", "function quadraticPrimes(range) {",
" // Good luck!", " // Good luck!",
" return true;", " return range;",
"}", "}",
"", "",
"euler27();" "quadraticPrimes(1000);"
], ],
"description": [ "description": [
"Euler discovered the remarkable quadratic formula:", "Euler discovered the remarkable quadratic formula:",
@ -861,7 +864,7 @@
"The incredible formula $n^2 - 79n + 1601$ was discovered, which produces 80 primes for the consecutive values $0 \\le n \\le 79$. The product of the coefficients, 79 and 1601, is 126479.", "The incredible formula $n^2 - 79n + 1601$ was discovered, which produces 80 primes for the consecutive values $0 \\le n \\le 79$. The product of the coefficients, 79 and 1601, is 126479.",
"Considering quadratics of the form:", "Considering quadratics of the form:",
"", "",
"$n^2 + an + b$, where $|a| < 1000$ and $|b| \\le 1000$where $|n|$ is the modulus/absolute value of $n$e.g. $|11| = 11$ and $|-4| = 4$", "$n^2 + an + b$, where $|a| < range$ and $|b| \\le range$where $|n|$ is the modulus/absolute value of $n$e.g. $|11| = 11$ and $|-4| = 4$",
"", "",
"Find the product of the coefficients, $a$ and $b$, for the quadratic expression that produces the maximum number of primes for consecutive values of $n$, starting with $n = 0$." "Find the product of the coefficients, $a$ and $b$, for the quadratic expression that produces the maximum number of primes for consecutive values of $n$, starting with $n = 0$."
] ]