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 #15618pull/18182/head
parent
2dd7249057
commit
450267e22d
|
@ -3680,10 +3680,11 @@
|
|||
"In the game of <a href=\"https://en.wikipedia.org/wiki/Golf\" target=\"_blank\">golf</a> each hole has a <code>par</code> meaning the average number of <code>strokes</code> 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 <code>par</code> your <code>strokes</code> are, there is a different nickname.",
|
||||
"Your function will be passed <code>par</code> and <code>strokes</code> arguments. Return the correct string according to this table which lists the strokes in order of priority; top (highest) to bottom (lowest):",
|
||||
"<table class=\"table table-striped\"><thead><tr><th>Strokes</th><th>Return</th></tr></thead><tbody><tr><td>1</td><td>\"Hole-in-one!\"</td></tr><tr><td><= par - 2</td><td>\"Eagle\"</td></tr><tr><td>par - 1</td><td>\"Birdie\"</td></tr><tr><td>par</td><td>\"Par\"</td></tr><tr><td>par + 1</td><td>\"Bogey\"</td></tr><tr><td>par + 2</td><td>\"Double Bogey\"</td></tr><tr><td>>= par + 3</td><td>\"Go Home!\"</td></tr></tbody></table>",
|
||||
"<code>par</code> and <code>strokes</code> will always be numeric and positive."
|
||||
"<code>par</code> and <code>strokes</code> 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",
|
||||
" ",
|
||||
|
|
Loading…
Reference in New Issue