feat(seed): Added more assertion for problem twenty eight (#15913)

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

View File

@ -872,26 +872,30 @@
"type": "bonfire", "type": "bonfire",
"title": "Problem 28: Number spiral diagonals", "title": "Problem 28: Number spiral diagonals",
"tests": [ "tests": [
"assert.strictEqual(euler28(), 669171001, 'message: <code>euler28()</code> should return 669171001.');" "assert(spiralDiagonals(101) == 692101, 'message: <code>spiralDiagonals(101)</code> should return 692101.');",
"assert(spiralDiagonals(303) == 18591725, 'message: <code>spiralDiagonals(303)</code> should return 18591725.');",
"assert(spiralDiagonals(505) == 85986601, 'message: <code>spiralDiagonals(505)</code> should return 85986601.');",
"assert(spiralDiagonals(1001) == 669171001, 'message: <code>spiralDiagonals(1001)</code> should return 669171001.');"
], ],
"solutions": [], "solutions": [],
"translations": {}, "translations": {},
"challengeSeed": [ "challengeSeed": [
"function euler28() {", "function spiralDiagonals(n) {",
" // Good luck!", " // Good luck!",
" return true;", " return n;",
"}", "}",
"", "",
"euler28();" "spiralDiagonals(1001);"
], ],
"description": [ "description": [
"Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:", "Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:",
"21 22 23 24 25", "21 22 23 24 25",
"20  7  8  9 10", "20  7  8  9 10",
"19  6  1  2 11", "19  6  1  2 11",
"18  5  4  3 1217 16 15 14 13", "18  5  4  3 12",
"17 16 15 14 13",
"It can be verified that the sum of the numbers on the diagonals is 101.", "It can be verified that the sum of the numbers on the diagonals is 101.",
"What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?" "What is the sum of the numbers on the diagonals in a n by n spiral formed in the same way?"
] ]
}, },
{ {