Skip to content

dominoes: Apply new "input" policy #1065

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

Merged
merged 1 commit into from
Jan 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 37 additions & 13 deletions exercises/dominoes/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"exercise": "dominoes",
"version": "2.0.0",
"version": "2.1.0",
"comments": [
"Inputs are given as lists of two-element lists.",
"Feel free to convert the input to a sensible type in the specific language",
Expand Down Expand Up @@ -40,37 +40,49 @@
{
"description": "empty input = empty output",
"property": "canChain",
"input": [],
"input": {
"dominoes": []
},
"expected": true
},
{
"description": "singleton input = singleton output",
"property": "canChain",
"input": [[1, 1]],
"input": {
"dominoes": [[1, 1]]
},
"expected": true
},
{
"description": "singleton that can't be chained",
"property": "canChain",
"input": [[1, 2]],
"input": {
"dominoes": [[1, 2]]
},
"expected": false
},
{
"description": "three elements",
"property": "canChain",
"input": [[1, 2], [3, 1], [2, 3]],
"input": {
"dominoes": [[1, 2], [3, 1], [2, 3]]
},
"expected": true
},
{
"description": "can reverse dominoes",
"property": "canChain",
"input": [[1, 2], [1, 3], [2, 3]],
"input": {
"dominoes": [[1, 2], [1, 3], [2, 3]]
},
"expected": true
},
{
"description": "can't be chained",
"property": "canChain",
"input": [[1, 2], [4, 1], [2, 3]],
"input": {
"dominoes": [[1, 2], [4, 1], [2, 3]]
},
"expected": false
},
{
Expand All @@ -83,19 +95,25 @@
"as that is not a sufficient condition."
],
"property": "canChain",
"input": [[1, 1], [2, 2]],
"input": {
"dominoes": [[1, 1], [2, 2]]
},
"expected": false
},
{
"description": "disconnected - double loop",
"property": "canChain",
"input": [[1, 2], [2, 1], [3, 4], [4, 3]],
"input": {
"dominoes": [[1, 2], [2, 1], [3, 4], [4, 3]]
},
"expected": false
},
{
"description": "disconnected - single isolated",
"property": "canChain",
"input": [[1, 2], [2, 3], [3, 1], [4, 4]],
"input": {
"dominoes": [[1, 2], [2, 3], [3, 1], [4, 4]]
},
"expected": false
},
{
Expand All @@ -108,19 +126,25 @@
"You need to place the (2, 4) after the (1, 2) rather than the (2, 3)."
],
"property": "canChain",
"input": [[1, 2], [2, 3], [3, 1], [2, 4], [2, 4]],
"input": {
"dominoes": [[1, 2], [2, 3], [3, 1], [2, 4], [2, 4]]
},
"expected": true
},
{
"description": "separate loops",
"property": "canChain",
"input": [[1, 2], [2, 3], [3, 1], [1, 1], [2, 2], [3, 3]],
"input": {
"dominoes": [[1, 2], [2, 3], [3, 1], [1, 1], [2, 2], [3, 3]]
},
"expected": true
},
{
"description": "nine elements",
"property": "canChain",
"input": [[1, 2], [5, 3], [3, 1], [1, 2], [2, 4], [1, 6], [2, 3], [3, 4], [5, 6]],
"input": {
"dominoes": [[1, 2], [5, 3], [3, 1], [1, 2], [2, 4], [1, 6], [2, 3], [3, 4], [5, 6]]
},
"expected": true
}
]
Expand Down