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