From 1b8d28c0bed4db438dc8f5567113a10ac08e4832 Mon Sep 17 00:00:00 2001 From: Alvin Kristanto Date: Fri, 10 Nov 2017 09:38:07 +0700 Subject: [PATCH] feat(seed): Added more assertions for Project Euler (#16065) --- .../project-euler-problems.json | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json b/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json index 2816547542..b27b5438c3 100644 --- a/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json +++ b/challenges/08-coding-interview-questions-and-take-home-assignments/project-euler-problems.json @@ -1194,22 +1194,25 @@ "type": "bonfire", "title": "Problem 39: Integer right triangles", "tests": [ - "assert.strictEqual(euler39(), 840, 'message: euler39() should return 840.');" + "assert(intRightTriangles(500) == 420, 'message: intRightTriangles(500) should return 420.');", + "assert(intRightTriangles(800) == 420, 'message: intRightTriangles(800) should return 420.');", + "assert(intRightTriangles(900) == 840, 'message: intRightTriangles(900) should return 840.');", + "assert(intRightTriangles(1000) == 840, 'message: intRightTriangles(1000) should return 840.');" ], "solutions": [], "translations": {}, "challengeSeed": [ - "function euler39() {", + "function intRightTriangles(n) {", " // Good luck!", - " return true;", + " return n;", "}", "", - "euler39();" + "intRightTriangles(1000);" ], "description": [ "If p is the perimeter of a right angle triangle with integral length sides, {a,b,c}, there are exactly three solutions for p = 120.", "{20,48,52}, {24,45,51}, {30,40,50}", - "For which value of p ≤ 1000, is the number of solutions maximised?" + "For which value of p ≤ n, is the number of solutions maximised?" ] }, {