Write a function with a single string parameter and a boolean return value. The function should return true iff the string is a palindrome character-wise.

Alternatively, write a program that reads a string from standard input and writes 1/0 to standard output depending on whether the string is palindrome or not.

The code itself should be a palindrome. The structure of the code visually documents what the code is about.

Since this is all about beauty of code, the code with the most votes wins.

  • \$\begingroup\$ @KendallFrey you are right... I mistakenly searched for palyndrome with y. \$\endgroup\$ Jan 29, 2014 at 15:13
  • 1
    \$\begingroup\$ Would adding another constraint make the question unique enough? I notice that most of the solutions to the other problem use comments. I think it would be interesting to see a challenge where comments are forbidden. \$\endgroup\$
    – Josh
    Jan 29, 2014 at 15:20
  • \$\begingroup\$ @Josh good point, but I see the duplicate question already has some very nice answers without using comments. \$\endgroup\$ Jan 29, 2014 at 15:27
  • \$\begingroup\$ Maybe mirroring, without using comments? - ( -> ), [ -> ], etc. \$\endgroup\$
    – eithed
    Jan 29, 2014 at 16:51


This site is temporarily in read-only mode and not accepting new answers.

Browse other questions tagged .