Golf Code
This commit is contained in:
parent
a6d796fb88
commit
455a59c61a
@ -2808,8 +2808,8 @@
|
||||
"id": "5664820f61c48e80c9fa476c",
|
||||
"title": "Golf Code",
|
||||
"description": [
|
||||
"In the game of golf each hole has a <dfn>par</dfn> for the average number of <dfn>strokes</dfn> needed to sink the ball. Depending on how far above or below <code>par</code> your <code>stokes</code> are, there is a different nickname.",
|
||||
"Your function will be passed a <code>par</code> and <code>strokes</code>. Return strings according to this table:",
|
||||
"In the game of golf each hole has a <dfn>par</dfn> for the average number of <dfn>strokes</dfn> needed to sink the ball. Depending on how far above or below <code>par</code> your <code>stokes</code> are, there is a different nickname.",
|
||||
"Your function will be passed a <code>par</code> and <code>strokes</code>. Return strings according to this table (based on order of priority - top (highest) to bottom (lowest)):",
|
||||
"<table class=\"table table-striped\"><thead><tr><th>Stokes</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."
|
||||
],
|
||||
@ -2820,6 +2820,7 @@
|
||||
"assert(golfScore(5, 2) === \"Eagle\", 'message: <code>golfScore(4, 2)</code> should return \"Eagle\"');",
|
||||
"assert(golfScore(4, 3) === \"Birdie\", 'message: <code>golfScore(4, 3)</code> should return \"Birdie\"');",
|
||||
"assert(golfScore(4, 4) === \"Par\", 'message: <code>golfScore(4, 4)</code> should return \"Par\"');",
|
||||
"assert(golfScore(1, 1) === \"Hole-in-one!\", 'message: <code>golfScore(1, 1)</code> should return \"Hole-in-one!\"');",
|
||||
"assert(golfScore(5, 5) === \"Par\", 'message: <code>golfScore(5, 5)</code> should return \"Par\"');",
|
||||
"assert(golfScore(4, 5) === \"Bogey\", 'message: <code>golfScore(4, 5)</code> should return \"Bogey\"');",
|
||||
"assert(golfScore(4, 6) === \"Double Bogey\", 'message: <code>golfScore(4, 6)</code> should return \"Double Bogey\"');",
|
||||
@ -2829,7 +2830,7 @@
|
||||
"challengeSeed": [
|
||||
"function golfScore(par, strokes) {",
|
||||
" // Only change code below this line",
|
||||
"",
|
||||
" ",
|
||||
" ",
|
||||
" return \"Change Me\";",
|
||||
" // Only change code above this line",
|
||||
|
Loading…
x
Reference in New Issue
Block a user