Palindromic palindrome checker Write a program to test if a string is palindromic, with the added condition that the program be palindromic itself.
Ruby

z=gets;puts *z.reverse==z&amp;&amp;1||0||1&amp;&amp;z==esrever.z* stup;steg=z


Prints 1 if the input is a palindrome, 0 if it isn't. Input without linebreak.

Doesn't use any comments, instead it uses 2 tricks:


Short-circuiting: 0 is true-ish in Ruby (only nil and false evaluate to false), so 1&amp;&amp;z==esrever.z* stup isn't evaluated and thus can't raise a runtime exception
The splat/multiplication operator (*): To avoid a syntax error in z=esrever.z stup, we force the parser to parse this as z=esrever.z()*stup by adding a *. On the other side, the * is parsed as a splat operator, which in a function call splits an array in a series of parameters. If there's only one element instead of an array, it basically does nothing, so puts *foo is equivalent to puts foo.


Obvious solution using comments (prints true/false):

puts gets.reverse==$_#_$==esrever.steg stup