Two dimensional chiral objects are not chiral in three dimensional space. This is because you can flip them over which is equivalent to taking the mirror image unlike in two dimensions where only rotations in the plane of the object are allowed which cannot reproduce the effect of a mirror operation. In this challenge, we will be deciding whether three dimensional texts are chiral.
Some definitions
- Three dimensional text: A rectangular three dimensional array of characters. In this challenge, programs will only need to handle nonwhitespace printable ASCII (
!
through~
). - Mirror operation: The operation of reversing the order of characters along a single axis of the three dimensional text.
Rotations can be thought of intuitively, but here is an explicit definition for those who will eventually ask.
- 90-degree rotation: The operation of transposing each plane perpendicular to a specific axis (say \$i\$), then applying a mirror operation to an axis other than \$i\$.
- Rotation: A succession of 90-degree rotations.
- Chiral: A three dimensional text is chiral if after applying any single mirror operation, there does not exist a rotation of the new text that reproduces the original text. A text is not chiral if after applying a single mirror operation the new text can be rotated back to the original text.
A slightly more concise definition of chirality is lack of existence of an improper rotation under which an object is invariant.
Task
In whatever format you prefer, take a three dimensional text as input.
Output one of two consistent values, one indicating that the text is chiral and one indicating that it is not.
Shortest code wins.
Examples
In each section, the vertical pipes (|
) separate the test cases. Within each test case, layers of the three dimensional texts are separated by blank lines.
Not chiral
Z--Z | i~ | Qx | a | abaLIa
---- | >> | xx | b | N#)*@"
Z--Z | | | | }-3}#k
| >> | QQ | d | ../..'
Z--Z | ~i | QQ | e |
---- | | | |
Z--Z | | | f |
| | | g |
Chiral
Z--Z | *k | Qxxx | a*
---- | <0 | xxxx | **
Z--- | | |
| l7 | QQQQ | **
Z--- | GB | QQQQ | a*
---- | | |
Z--Z | q~ | | **
| ]J | | *a