From def425a66f4a428c4e6e65c07cb76df03b84d7b3 Mon Sep 17 00:00:00 2001 From: Milo Hartsoe Date: Sat, 5 Aug 2017 14:33:16 -0400 Subject: [PATCH] fix(seed, challenges, 02-javascript-algorithms-and-data-structures, basic-javascript.json, Golf Code): Adds an array of the names to the Golf Code challe (#15678) This adds an array of names for the Golf Code challenge and adds a sentence about the array to the description of the challenge. Closes #15618 --- .../basic-javascript.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json index 0244616b71..e9d0f2dcc8 100644 --- a/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json +++ b/seed/challenges/02-javascript-algorithms-and-data-structures/basic-javascript.json @@ -2625,7 +2625,7 @@ ], "tests": [ "assert(typeof timesFive === 'function', 'message: timesFive should be a function');", - "assert(code.match(/timesFive\\(\\s*\\d+\\s*\\)/g), 'message: function timesFive should be called with a number');", + "assert(code.match(/timesFive\\(\\s*\\d+\\s*\\)/g), 'message: function timesFive should be called with a number');", "assert(timesFive(5) === 25, 'message: timesFive(5) should return 25');", "assert(timesFive(2) === 10, 'message: timesFive(2) should return 10');", "assert(timesFive(0) === 0, 'message: timesFive(0) should return 0');" @@ -3680,10 +3680,11 @@ "In the game of golf each hole has a par meaning the average number of strokes a golfer is expected to make in order to sink the ball in a hole to complete the play. Depending on how far above or below par your strokes are, there is a different nickname.", "Your function will be passed par and strokes arguments. Return the correct string according to this table which lists the strokes in order of priority; top (highest) to bottom (lowest):", "
StrokesReturn
1\"Hole-in-one!\"
<= par - 2\"Eagle\"
par - 1\"Birdie\"
par\"Par\"
par + 1\"Bogey\"
par + 2\"Double Bogey\"
>= par + 3\"Go Home!\"
", - "par and strokes will always be numeric and positive." + "par and strokes will always be numeric and positive. We have added an array of all the names for your convenience." ], "releasedOn": "January 1, 2016", "challengeSeed": [ + "var names = [\"Hole-in-one!\", \"Eagle\", \"Birdie\", \"Par\", \"Bogey\", \"Double Bogey\", \"Go Home!\"];", "function golfScore(par, strokes) {", " // Only change code below this line", " ",