Path: utzoo!mnetor!uunet!husc6!rutgers!umd5!uvaarpa!mcnc!rti!ntcsd1!stephenk From: stephenk@ntcsd1.UUCP (Stephen Keilholz) Newsgroups: comp.lang.c Subject: Re: ugly code Message-ID: <212@ntcsd1.UUCP> Date: 9 Dec 87 20:31:42 GMT References: <1311@lll-lcc.aRpA> Reply-To: stephenk@ntcsd1.UUCP (Stephen Keilholz) Distribution: na Organization: Northern Telecom, Research Triangle Park, North Carolina Lines: 23 In article <1311@lll-lcc.aRpA> booloo@lll-lcc.UUCP (Mark Boolootian) writes: > >------> > >I have heard of a little piece of C code that is particularly ugly (read un- >readable) that does nothing more than print "hello world" (or something to that >effect). The main thing is that the code looks like it wouldn't even compile >let alone actually produce some result. If anyone has a copy of this program, >I would really appreciate it if they would email it to me. Thanks and I'll >let you figure out the path cause I've no idea where I am. >mb I have never seen one that prints "hello world" that was ugly but the following example of ugly code was presented for the final exam of a 'C' language course I just completed at North Carolina State University: main(){printf(&unix["\021%six\010\0"],(unix)["have"]+"fun"-0x60)} I'm pretty sure that the above is correct but I'm doing it from memory so take that for what it's worth. Stephen Keilholz (New user of the network)