Xref: utzoo comp.lang.c:17517 comp.sys.amiga.tech:4553 comp.lang.modula2:1411 comp.lang.pascal:1684 rec.humor:20568 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!rochester!rit!ultb!ritcsh!kyle From: kyle@ritcsh.UUCP (Kyle Saunders) Newsgroups: comp.lang.c,comp.sys.amiga.tech,comp.lang.modula2,comp.lang.pascal,rec.humor Subject: Re: Another Silly programming puzzle.... Summary: cheapo solution Keywords: contest silly Message-ID: <2714@ritcsh.UUCP> Date: 6 Apr 89 20:57:10 GMT References: <1210@microsoft.UUCP> Followup-To: comp.sys.amiga.tech Organization: Computer Science House @ RIT - Rochester, NY Lines: 37 In article <1210@microsoft.UUCP>, t-iaind@microsoft.UUCP (Iain Davidson) writes: > (This is my first BIG post, so if you want to flame, flame low and send away) > > For those still silly over the LAST puzzle/challange.... here's another one. > > Puzzle: > Write a "simple" program to convert rec.humor (rot13) jokes to > a output readable by human eyes... > C version: (uses redirection/pipes) #include main() { char c; while ((c = getchar()) != EOF) { if ((c >= 'A') && (c <= 'Z')) c = ((c-'A'+13) % 26) + 'A'; else if ((c >= 'a') && (c <= 'z')) c = ((c-'a'+13) % 26) + 'a'; putchar(c); } } sh version: (also uses redirection/pipes) #rot13.sh #!/bin/sh tr A-MN-Za-mn-z N-ZA-Mn-za-m - Kyle Saunders Computer Science House @ Rochester Institute of Technology {known.galaxy}!ccicpg!cci632!ritcsh!kyle or kyle%ritcsh@rit.RIT.EDU