From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/4117 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: ROT13 and alike Date: Mon, 19 Feb 2001 11:20:04 +0100 Sender: owner-ntg-context@let.uu.nl Message-ID: <3.0.6.32.20010219112004.0180d100@server-1> References: <001101c09844$ebd9ee20$a3ccfea9@nuovo> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: main.gmane.org 1035394804 23033 80.91.224.250 (23 Oct 2002 17:40:04 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:40:04 +0000 (UTC) Cc: "ConTeXt" Original-To: "Giuseppe Bilotta" In-Reply-To: <001101c09844$ebd9ee20$a3ccfea9@nuovo> Xref: main.gmane.org gmane.comp.tex.context:4117 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:4117 At 07:15 PM 2/16/01 +0100, Giuseppe Bilotta wrote: >ROT13, for those who don't know, is a way to code text by swapping >the first 13 letters of the latin alphabet with the last 13 letters; >appling ROT13 to ROT13ed code returns the original message. > >This kind of things can be achived with Virtual Fonts, but I don't >like the approach at all. Also Omega's OCP lists can do similar things. >Now, I was looking for another approach, working in pure TeX, and came >to the code snippet in the attached file (actually, che coding it >applies is not ROT13 but the code of a former Italian secret society, >"carbonari"; but the idea is similar). It works ... almost. Given that this secret society is okay i can provide a better solution. \starttext \startmapping[rot13] \definecasemaps 65 to 77 lc +13 uc +13 \definecasemaps 78 to 90 lc -13 uc -13 \definecasemaps 97 to 109 lc +13 uc +13 \definecasemaps 110 to 122 lc -13 uc -13 \stopmapping \def\ToRotThirteen #1{{\enablemapping[rot13]\lowercase{#1}}} \def\FromRotThirteen#1{{\enablemapping[rot13]\uppercase{#1}}} Ecco una prova di alfabeto carbonaro. \ToRotThirteen{Ecco una prova di alfabeto carbonaro.} \FromRotThirteen{\ToRotThirteen{Ecco una prova di alfabeto carbonaro.}} \stoptext ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------