ROT13 (was Re: [req] Lips / Kiss)
From Hilton Janfield <val...@bcgroup.net>
· alt.ascii-art
· 10 Mar 1998 00:00 · View full thread
· report
[from alt.ascii-art "discussion" on what to do when your newsreader doesn't support ROT13] >3. Use this C program: > >#include <stdlib.h> >#include <stdio.h> > >main() >{ > int ch; > > while ((ch = getchar()) != EOF) > { > if ((ch >= 65) && (ch <= 90)) > { > ch = 65 + ((ch - 65) + 13) % 26; > } > if ((ch >= 97) && (ch <= 122)) > { > ch = 97 + ((ch - 97) + 13) % 26; > } > printf("%c", ch); > } >} > >>[from a reply] >>Or use this code: >> >>#include <stdio.h> >>#define rot13(c) >>(((c>64)&(c<91))?(65+(c-52)%26):((c>96)&(c<123))?(97+(c-84)%26):c) >>void main() {int i; while ((i=getchar())!=-1) putchar(rot13(i));} > > 4. Write your own program, in your favourite programming language. Hmm... well, lets see here... as I recall, ROT13 is a simple transposition of A-M and N-Z... Here's a little Pascal for ya all! :) Reads in a line program ROT13; var s: string; x: byte; begin write('Enter the string to do a ROT13 on: '); readln(s); for x := 1 to length(s) do case s[x] of 'A'..'M', 'a'..'m': inc(s[x], 13); 'N'..'Z', 'n'..'z': dec(s[x], 13); end; write('ROT13 string: '); writeln(s); end. Or, if your a tightcoder <G> program ROT13;var s:string;x:byte;begin write('Enter the string to do a ROT13 on: ');readln(s);for x:=1 to length(s) do case s[x] of 'A'..'M','a'..'m':inc(s[x],13);'N'..'Z','n'..'z':dec(s[x],13);end;write('ROT13 string: ');writeln(s);end.
Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,6f8790cec9c439f3 X-Google-Attributes: gidf996b,public X-Google-Thread: 111659,e3f32c6b695b12d1,start X-Google-Attributes: gid111659,public From: Hilton Janfield <val...@bcgroup.net> Subject: ROT13 (was Re: [req] Lips / Kiss) Date: 1998/03/10 Message-ID: <350...@bcgroup.net>#1/1 X-Deja-AN: 332617643 Content-Transfer-Encoding: 7bit References: <350...@news.mag-net.com> <350...@on.spammer> Content-Type: text/plain; charset=us-ascii Organization: darkfire Productions Mime-Version: 1.0 Newsgroups: alt.ascii-art,comp.lang.pascal.borland
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this message.
This message was posted publicly to the newsgroup
alt.ascii-art
in 1998 and is mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you the author? Contact us to get your posts attributed, connected to your artist profile, or removed.
Report this message
Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.