When a number is shown on a calculator, it's possible to consider what various transformations of that number would look like. For example, on a seven-segment display, 2 is shown like this:
And when flipped horizontally it looks like this:
As such, the mirror image of 2 is 5.
The task in this challenge is to take a single-digit number, and return the number that's its mirror image (if possible). If its mirror image does not look like a number, return the number rotated 180 degrees (if possible). If neither of these are the case, return -1.
Here's the full list of inputs and outputs your program needs to handle:
Input Output 0 0 1 -1 2 5 3 -1 4 -1 5 2 6 9 7 -1 8 8 9 6
As a code-golf challenge, the shortest code wins!