Re: ROT13 (was: sigs)
From Carl R. White <crw...@192.168.185.95>
· alt.ascii-art
· 3 Dec 1997 00:00 · View full thread
· report
On 30 Nov 1997, Tim Park wrote: > > Veronica Karlsson (dre...@on.spammer) writes: > > Naqernf Freise jebgr: > >> Veronica Karlsson wrote: > >> > But that only works for text in posts people have already sent, not in > >> > text you are writing... (at least I haven't found that button yet...) > >> OK, I think writing a C program is the most elegant > >> way to do it and you did it. > > And it took me several minutes... (I had to look up "mod") > > What about (from memory ^_^;) > > tr A-Z M-ZA-N <file | tr a-z m-za-n I already posted the tr solution ;) (Head swells, feels bad). Try this for ROT-ANYNUMBER(1-26) Unix ksh only: -------------------------------------------------------------------------- #!/bin/ksh -p # Rot X pipe - like rot13. 1<=X<=26 lc="abcdefghijklmnopqrstuvwxyz" uc="ABCDEFGHIJKLMNOPQRSTUVWXYZ" x=$((${1}+1)) while (( x > 26 )) ; do x=$((x - 26)) done while (( x <= 0 )) ; do x=$((x + 26)) done lc2=$(echo $lc$lc | awk '{print substr($1, '$x', 26)}') uc2=$(echo $uc$uc | awk '{print substr($1, '$x', 26)}') tr "$lc$uc" "$lc2$uc2" -------------------------------------------------------------------------- This is starting to look more like alt.unix.wizards! -------------------------------------------------------------------------- For instance, this is "echo {something :) } | rot 13" : Gb or be abg gb or gung vf gur dhrfgvba and this is something similar in rot 7: Hshz wvvy Fvypjr, ol pz iba h zrbss :) To undo rotX you must use rot(26 - X), which is why people prefer rot13! e.g. rot 7 -> rot 19 etc. -- Carl R White | e-mail...: crw...@-comp.brad.ac.uk | finger...: crw...@-dcsun1.comp.brad.ac.uk | web......: http://www.student.comp.brad.ac.uk/~crwhite/ *** Anti-Spam: Fake IP address in Header. Change '-@-' to '@' in .sig. ***
Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f996b,5e20dd0eb81e05d7 X-Google-Attributes: gidf996b,public From: "Carl R. White" <crwhite@192.168.185.95> Subject: Re: ROT13 (was: sigs) Date: 1997/12/03 Message-ID: <Pin...@dcsun4.comp.brad.ac.uk>#1/1 X-Deja-AN: 294846602 References: <347...@inspace.net> <347...@on.spammer> <65npea$do8$9...@usenet88.supernews.com> <6im...@mfju.hit.handshake.de> <348...@on.spammer> <348...@mpq.mpg.de> <348...@on.spammer> <65qonf$9b...@freenet-news.carleton.ca> X-Sender: crw...@dcsun4.comp.brad.ac.uk Organization: University of Bradford Reply-To: crw...@comp.brad.ac.uk Newsgroups: alt.ascii-art
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
|\__/,| (`\ |_ _ |.--.) ) ( T ) / (((^_(((/(((_/
, _ , ( o o ) /'` ' `'\ |'''''''| |\\'''//| """
,~~--~~-. + | |\ || |~ |`,/-\ *\_) \_) `-'
__
\ \ _ _
\**\ ___\/ \
X*#####*+^^\_\
o/\ \
\__\ .------------. |\\//\\//\\//| |//\\//\\//\\| |\\//\\//\\//| |//\\//\\//\\| '------------'
_______ /` _____ `\;, /__(^===^)__\';, / ::: \ ,; | ::: | ,;' '._______.'`jgs
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 1997 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.