A shape is chiral if no amount of rotation can make it look like it's mirror image. In this puzzle we will be writing chiral computer programs.
For this puzzle we will think of a program as a rectangular matrix of characters. As such all solutions to this challenge must be rectangular (that is all lines must be of the same length). We can rotate these programs in quarter turn increments. For example the program
The quickish fish
lept deftly
rightwards
When rotated a quarter turn clockwise looks like
T
h
r e
i
glq
heu
tpi
wtc
a k
rdi
des
sfh
t
lf
yi
s
h
We can also reflect these programs. Here is the same program reflected over a vertical axis:
hsif hsikciuq ehT
yltfed tpel
sdrawthgir
A chiral program is a program that when rotated any number of times will always output "left
". However when reflected produces a program that outputs "right
" no matter how many times it is rotated.
Your task is to write a chiral program in as few bytes as possible.
Additional Rules
Output is not-case sensitive but should be consistent. (e.g. You may output "
LEFT
" and "rIgHt
" but this casing must be consistent under rotations)Lines are to be split either on a newline or a newline and a linefeed.
Your program must be a rectangle, you can pad it with spaces or comments but each line must have the same length.
You may optionally have a trailing newline (or newline and linefeed) on all of your programs if you wish.
:set virtualedit=all
mode. The initialBool
output checks if the input is equal to its own rotation, which simplifies things. Removing the{-
makes it print the reflected input. \$\endgroup\$