Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version nyu B notes v1.5 12/10/84; site csd2.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!gatech!seismo!cmcl2!csd2!dimitrov From: dimitrov@csd2.UUCP (Isaac Dimitrovsky) Newsgroups: net.lang.c Subject: Re: Comments on this program please... Message-ID: <3090011@csd2.UUCP> Date: Sun, 24-Nov-85 12:06:00 EST Article-I.D.: csd2.3090011 Posted: Sun Nov 24 12:06:00 1985 Date-Received: Mon, 25-Nov-85 08:05:45 EST References: <2389@ukma.UUCP> Organization: New York University Lines: 46 /* csd2:net.lang.c / david@ukma.UUCP (David Herron, NPR Lover) / 5:42 pm Nov 22, 1985 */ 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. /* ---------- */