Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 alpha 4/3/85; site ukma.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!david From: david@ukma.UUCP (David Herron, NPR Lover) Newsgroups: net.lang,net.lang.c Subject: Comments on this program please... Message-ID: <2389@ukma.UUCP> Date: Fri, 22-Nov-85 17:42:06 EST Article-I.D.: ukma.2389 Posted: Fri Nov 22 17:42:06 1985 Date-Received: Sun, 24-Nov-85 05:25:48 EST Followup-To: net.lang Organization: U of Kentucky, Mathematical Sciences, Lexington KY Lines: 44 Xref: watmath net.lang:1965 net.lang.c:7161 Everybody I've shown this program to has *groaned* and complained about what a nasssty program it was... This program was written to help decode a bitnet routing table that I had been netcopy'd to me and didn't get translated into ascii. So after running dd over it, the line markers had disappeared into never never land. But from looking real closely at the file I could see that each line was supposed to start with ROUTE..... thus this program: I think it's *cute*! #include main() { register int r, o, u, t, e; while ((r = getchar()) != EOF) { if (r == 'R') if ((o = getchar()) == 'O') if ((u = getchar()) == 'U') if ((t = getchar()) == 'T') if ((e = getchar()) == 'E') printf("\nROUTE"); else printf("ROUT%c", e); else printf("ROU%c", t); else printf("RO%c", u); else printf("R%c", o); else putchar(r); } putchar('\n'); } -- David Herron, cbosgd!ukma!david, david@UKMA.BITNET. Experience is something you don't get until just after you need it.