home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
- From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
- Subject: Re: Another C palindrome puzzle
- Message-ID: <9235703.672@mulga.cs.mu.OZ.AU>
- Sender: news@cs.mu.OZ.AU
- Organization: Computer Science, University of Melbourne, Australia
- References: <9234503.17437@mulga.cs.mu.OZ.AU> <1992Dec17.223414.164558@evolving.com>
- Date: Mon, 21 Dec 1992 16:39:38 GMT
- Lines: 35
-
- manus@evolving.com (Manus Hand) writes:
-
- >fjh@munta.cs.mu.OZ.AU (Fergus James Henderson) writes:
- >>
- >> Next challenge: Write a palindromic "hello world" program in C without
- >> using comments, #if, or #ifdef. I think it should be possible.
- >
- >Challenge accepted!
- [neat solutions omitted]
- >
- >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!>>>
-
- I liked your idea of using #pragma.
- Here's my solution with no comments, #ifs, #ifdefs, or #defines.
-
- #pragma amgarp#;""\
-
- main(){char s[]="\
- Hello World"\
- ;puts(s);}
- #pragma "=s*rahc"
- char*s="amgarp#};)s(stup;\"dlroW olleH\"=][s rahc{ )(niam\"";
- #pragma amgarp#
-
- Next challenge: (it's starting to get real hard, folks)
- No comments, #ifs, #ifdefs, #defines, and _no #pragmas_.
- I'm not sure if this one is possible.
-
- --
- Fergus Henderson fjh@munta.cs.mu.OZ.AU
- This .signature virus is a self-referential statement that is true - but
- you will only be able to consistently believe it if you copy it to your own
- .signature file!
-