home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18725 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.7 KB

  1. Path: sparky!uunet!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Another C palindrome puzzle
  5. Message-ID: <1992Dec21.000559.12081@thunder.mcrcim.mcgill.edu>
  6. Date: 21 Dec 92 00:05:59 GMT
  7. References: <1992Dec17.223414.164558@evolving.com> <BzGJt5.5nL@sci.kun.nl>
  8. Organization: McGill Research Centre for Intelligent Machines
  9. Lines: 30
  10.  
  11. In article <BzGJt5.5nL@sci.kun.nl>, Ron Wichers Schreur <ronny@cs.kun.nl> writes:
  12. > Manus Hand, manus@evolving.com writes:
  13. > [...about palindromic programs...]
  14. >> As Henderson did, I assert that new-line characters are not
  15. >> significant when determining palindromism (palindromicity?).
  16. > In this puzzle, new-line characters are significant.
  17.  
  18. Why?  If I write an English palindrome like "A man, a plan, a canal -
  19. Panama!" you don't complain that it's not a palindrome because it
  20. reverses to "!amanaP
  21. - lanac a ,nalp a ,nam A".  Punctuation, case, and whitespace
  22. (including line breaks) are ignored.
  23.  
  24. Hence, I submit that we should ignore whitespace, including newlines,
  25. and alphabetic case.  (Not punctuation, because it's hard to say just
  26. what "punctuation" is in C.)  Extra points, of course, for palindromes
  27. that treat whitespace as significant....
  28.  
  29. >> Now I suppose I have to come up with the NEXT challenge.
  30. >> Okaaaayyyy.... how about a palindromic "Hello world" program, with
  31. >> no comments, #if's, #ifdef's, <<<OR #define's!>>>
  32. > This looks a real challenge (I don't think there's a solution).
  33.  
  34. I don't either.  Consider what the first token in such a program might
  35. be.  I don't think it's possible for its reversal to be the last token.
  36.  
  37.                     der Mouse
  38.  
  39.                 mouse@larry.mcrcim.mcgill.edu
  40.