Skip to content
This repository was archived by the owner on Sep 25, 2019. It is now read-only.

Commit ada67f8

Browse files
alvinklQuincyLarson
authored andcommitted
feat(seed): Added more assertion for problem twenty eight (#15913)
1 parent f0a41f1 commit ada67f8

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -872,26 +872,30 @@
872872
"type": "bonfire",
873873
"title": "Problem 28: Number spiral diagonals",
874874
"tests": [
875-
"assert.strictEqual(euler28(), 669171001, 'message: <code>euler28()</code> should return 669171001.');"
875+
"assert(spiralDiagonals(101) == 692101, 'message: <code>spiralDiagonals(101)</code> should return 692101.');",
876+
"assert(spiralDiagonals(303) == 18591725, 'message: <code>spiralDiagonals(303)</code> should return 18591725.');",
877+
"assert(spiralDiagonals(505) == 85986601, 'message: <code>spiralDiagonals(505)</code> should return 85986601.');",
878+
"assert(spiralDiagonals(1001) == 669171001, 'message: <code>spiralDiagonals(1001)</code> should return 669171001.');"
876879
],
877880
"solutions": [],
878881
"translations": {},
879882
"challengeSeed": [
880-
"function euler28() {",
883+
"function spiralDiagonals(n) {",
881884
" // Good luck!",
882-
" return true;",
885+
" return n;",
883886
"}",
884887
"",
885-
"euler28();"
888+
"spiralDiagonals(1001);"
886889
],
887890
"description": [
888891
"Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:",
889892
"21 22 23 24 25",
890893
"20  7  8  9 10",
891894
"19  6  1  2 11",
892-
"18  5  4  3 1217 16 15 14 13",
895+
"18  5  4  3 12",
896+
"17 16 15 14 13",
893897
"It can be verified that the sum of the numbers on the diagonals is 101.",
894-
"What is the sum of the numbers on the diagonals in a 1001 by 1001 spiral formed in the same way?"
898+
"What is the sum of the numbers on the diagonals in a n by n spiral formed in the same way?"
895899
]
896900
},
897901
{

0 commit comments

Comments
 (0)