Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Darts] Slim down generated method names #1530

Merged
merged 15 commits into from
Jul 1, 2019
88 changes: 53 additions & 35 deletions exercises/darts/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"exercise": "darts",
"version": "2.0.0",
"version": "2.1.0",
"comments": [
"Return the correct amount earned by a dart landing in a given point in the target problem"
"Return the correct amount earned by a dart landing in a given point in the target."
bencoman marked this conversation as resolved.
Show resolved Hide resolved
bencoman marked this conversation as resolved.
Show resolved Hide resolved
],
"cases": [
{
"property": "score",
"description": "A dart lands outside the target",
"description": "Missed target",
"input": {
"x": -9,
"y": 9
Expand All @@ -16,7 +16,7 @@
},
{
"property": "score",
"description": "A dart lands just in the border of the target",
"description": "On outer circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 0,
"y": 10
Expand All @@ -25,34 +25,16 @@
},
{
"property": "score",
"description": "A dart lands in the outer circle",
"description": "On middle circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 4,
"y": 4
},
"expected": 1
},
{
"property": "score",
"description": "A dart lands right in the border between outer and middle circles",
"input": {
"x": 5,
"x": -5,
"y": 0
},
"expected": 5
},
{
"property": "score",
"description": "A dart lands in the middle circle",
"input": {
"x": 0.8,
"y": -0.8
},
"expected": 5
},
{
"property": "score",
"description": "A dart lands right in the border between middle and inner circles",
"description": "On inner circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 0,
"y": -1
Expand All @@ -61,7 +43,7 @@
},
{
"property": "score",
"description": "A dart lands in the inner circle",
"description": "Near centre",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": -0.1,
"y": -0.1
Expand All @@ -70,30 +52,66 @@
},
{
"property": "score",
"description": "A dart whose coordinates sum to > 1 but whose radius to origin is <= 1 is scored in the inner circle",
"description": "Just within inner circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 0.4,
"y": 0.8
"x": 0.7,
"y": 0.7
},
"expected": 10
},
{
"property": "score",
"description": "A dart whose coordinates sum to > 5 but whose radius to origin is <= 5 is scored in the middle circle",
"description": "Just beyond inner circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 2,
"y": 4
"x": 0.8,
"y": -0.8
},
"expected": 5
},
{
"property": "score",
"description": "A dart whose coordinates sum to > 10 but whose radius to origin is <= 10 is scored in the outer circle",
"description": "Just within middle circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": -3.5,
"y": 3.5
},
"expected": 5
},
{
"property": "score",
"description": "Just beyond middle circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 4,
"y": 8
"x": -3.6,
"y": -3.6
},
"expected": 1
},
{
"property": "score",
"description": "Just within outer circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": -7.0,
"y": 7.0
},
"expected": 1
},
{
"property": "score",
"description": "Just beyond outer circle",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 7.1,
"y": -7.1
},
"expected": 0
},
{
"property": "score",
"description": "Asymmetric position between inner and middle circles",
bencoman marked this conversation as resolved.
Show resolved Hide resolved
"input": {
"x": 0.5,
"y": -4
},
"expected": 5
}
]
}