Write some code that acts as a cat program. That is, to input a string and output it as is. But the normal reversion of your code must output the normal reversion of the input string. And the visual reversion of your code must output the visual reversion of the input string.
The normal reversion is the reversed character sequence of a string. The visual reversion is the normal reversion with the characters ()[]{}<>
replaced by )(][}{><
respectively.
You could use any codepage that has the characters ()[]{}<>
and is published before this challenge to define characters. You must use the same codepage for all your code. Your original code must be valid in this codepage, and applying either of your reversed code to that should yield itself.
This is code-golf, shortest code in bytes wins.
Example
For the string AB(XY)
, its normal and visual reversions are )YX(BA
and (YX)BA
respectively.
If your code (in a hypothetical language) is AB(XY)
, then the code )YX(BA
and (YX)BA
should output the normal and visual reversions of the input string respectively. And AB(XY)
should act as a cat program.