Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #489 from petertseng/secret-handshake-json
secret-handshake: Add canonical data (revives #159)
- Loading branch information
Showing
2 changed files
with
73 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
{ | ||
"commands": { | ||
"description": ["Create a handshake for a number"], | ||
"cases": [ | ||
{ | ||
"description": "wink for 1", | ||
"input": 1, | ||
"expected": ["wink"] | ||
}, | ||
{ | ||
"description": "double blink for 10", | ||
"input": 2, | ||
"expected": ["double blink"] | ||
}, | ||
{ | ||
"description": "close your eyes for 100", | ||
"input": 4, | ||
"expected": ["close your eyes"] | ||
}, | ||
{ | ||
"description": "jump for 1000", | ||
"input": 8, | ||
"expected": ["jump"] | ||
}, | ||
{ | ||
"description": "combine two actions", | ||
"input": 3, | ||
"expected": ["wink", "double blink"] | ||
}, | ||
{ | ||
"description": "reverse two actions", | ||
"input": 19, | ||
"expected": ["double blink", "wink"] | ||
}, | ||
{ | ||
"description": "reversing one action gives the same action", | ||
"input": 24, | ||
"expected": ["jump"] | ||
}, | ||
{ | ||
"description": "reversing no actions still gives no actions", | ||
"input": 16, | ||
"expected": [] | ||
}, | ||
{ | ||
"description": "all possible actions", | ||
"input": 15, | ||
"expected": ["wink", "double blink", "close your eyes", "jump"] | ||
}, | ||
{ | ||
"description": "reverse all possible actions", | ||
"input": 31, | ||
"expected": ["jump", "close your eyes", "double blink", "wink"] | ||
}, | ||
{ | ||
"description": "do nothing for zero", | ||
"input": 0, | ||
"expected": [] | ||
}, | ||
{ | ||
"description": "do nothing if lower 5 bits not set", | ||
"input": 32, | ||
"expected": [] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters