feat(seed): Added more assertions for Project Euler (#16057)

This commit is contained in:
Alvin Kristanto
2017-10-31 04:25:39 +07:00
committed by Quincy Larson
parent 224684ed45
commit 04cf144c9f

View File

@ -1139,21 +1139,24 @@
"type": "bonfire", "type": "bonfire",
"title": "Problem 37: Truncatable primes", "title": "Problem 37: Truncatable primes",
"tests": [ "tests": [
"assert.strictEqual(euler37(), 748317, 'message: <code>euler37()</code> should return 748317.');" "assert(truncatablePrimes(8) == 1986, 'message: <code>truncatablePrimes(8)</code> should return 1986.');",
"assert(truncatablePrimes(9) == 5123, 'message: <code>truncatablePrimes(9)</code> should return 5123.');",
"assert(truncatablePrimes(10) == 8920, 'message: <code>truncatablePrimes(10)</code> should return 8920.');",
"assert(truncatablePrimes(11) == 748317, 'message: <code>truncatablePrimes(11)</code> should return 748317.');"
], ],
"solutions": [], "solutions": [],
"translations": {}, "translations": {},
"challengeSeed": [ "challengeSeed": [
"function euler37() {", "function truncatablePrimes(n) {",
" // Good luck!", " // Good luck!",
" return true;", " return n;",
"}", "}",
"", "",
"euler37();" "truncatablePrimes(11);"
], ],
"description": [ "description": [
"The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.", "The number 3797 has an interesting property. Being prime itself, it is possible to continuously remove digits from left to right, and remain prime at each stage: 3797, 797, 97, and 7. Similarly we can work from right to left: 3797, 379, 37, and 3.",
"Find the sum of the only eleven primes that are both truncatable from left to right and right to left.", "Find the sum of the only n (8 <= n <= 11) primes that are both truncatable from left to right and right to left.",
"NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes." "NOTE: 2, 3, 5, and 7 are not considered to be truncatable primes."
] ]
}, },