This question is inspired by the cover of the book "Godel, Escher, Bach":
The challenge here is to write a function that tells if three given letters can produce a 3D sculpture that can be read from three sides.
For this exercise, the only letters you can use are 26 5px * 5px bitmaps:
Or in binary (A to Z):
01110 11110 01111 11110 11111 11111 11111 10001 11111 11111 10001 10000 10001 10001 01110 11110 01110 11110 01111 11111 10001 10001 10001 10001 10001 11111
10001 10001 10000 10001 10000 10000 10000 10001 00100 00100 10010 10000 11011 11001 10001 10001 10001 10001 10000 00100 10001 10001 10001 01010 01010 00010
10001 11110 10000 10001 11100 11110 10011 11111 00100 00100 11100 10000 10101 10101 10001 10001 10001 11111 01110 00100 10001 01010 10001 00100 00100 00100
11111 10001 10000 10001 10000 10000 10001 10001 00100 10100 10010 10000 10001 10011 10001 11110 10011 10010 00001 00100 10001 01010 10101 01010 00100 01000
10001 11110 01111 11110 11111 10000 11111 10001 11111 11100 10001 11111 10001 10001 01110 10000 01111 10001 11110 00100 01110 00100 01010 10001 00100 11111
The sculpture is formed by three letters in the following order:
- letter one on top,
- letter two on the left
- letter three on the right
- the bottom of letter one is bound to the top of the letter two.
Example:
Your function may accept as input three uppercase letters (three chars or three strings of one letter), and output a boolean (true/false or 0/1) telling if the corresponding sculpture can exist.
Example:
f("B","E","G") // true (because if you "sculpt out" B on top + E on the left + G on the right, and watch the three sides of the sculpture, you'll see exactly B, E and G as they are defined)
f("B","G","E") // false (because if you "sculpt out" B on top + G on the left + E on the right, and watch the three sides of the sculpture, you won't see a complete G and a complete E. Their shapes bother each other)
NB: you may return true even if the sculpture contains "flying pixels" (cubes or group of cubes that are attached to nothing).
Standard loopholes apply.
More precisely, you can't use external input besides the three letters, and you can't hardcode the 17576 possible answers in your source code
Shortest answer in characters in any language wins!
Have fun :)