Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 exptools 1/6/84; site ihnet.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!ihnet!eklhad From: eklhad@ihnet.UUCP (K. A. Dahlke) Newsgroups: net.lang.c Subject: self-reversing programs Message-ID: <159@ihnet.UUCP> Date: Fri, 7-Sep-84 15:02:04 EDT Article-I.D.: ihnet.159 Posted: Fri Sep 7 15:02:04 1984 Date-Received: Wed, 12-Sep-84 03:04:46 EDT Organization: AT&T Bell Labs, Naperville, IL Lines: 19 The following program prints itself in reverse. It is only 202 bytes long, and i can't find any way to make it shorter. There are (of course) no new lines in it, but i broke it up here for the sake of the net. char*q= "char*q=;p(c){putchar(c);} main(n){char*s=q+100;while(s-->q){ if(s==q+6&n)p(34),main(0),p(34); p(*s);}}"; p(c){putchar(c);} main(n){char*s=q+100;while(s-->q){ if(s==q+6&n)p(34),main(0),p(34); p(*s);}} Any shorter?? -- Karl Dahlke ihnp4!ihnet!eklhad