ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: "ConTeXt" <ntg-context@ntg.nl>
Subject: Re: ROT13 and alike
Date: Mon, 19 Feb 2001 11:20:04 +0100	[thread overview]
Message-ID: <3.0.6.32.20010219112004.0180d100@server-1> (raw)
In-Reply-To: <001101c09844$ebd9ee20$a3ccfea9@nuovo>

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
-------------------------------------------------------------------------


  parent reply	other threads:[~2001-02-19 10:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-16 18:15 Giuseppe Bilotta
2001-02-17 18:30 ` Taco Hoekwater
2001-02-18 12:50   ` Giuseppe Bilotta
2001-02-19 11:19     ` Hans Hagen
2001-02-19 10:20 ` Hans Hagen [this message]
2001-02-19 22:45   ` Giuseppe Bilotta
2001-02-20 11:29     ` Hans Hagen
2001-02-20 15:58   ` Giuseppe Bilotta
2001-03-12 20:37     ` Hans Hagen
2001-03-14  0:26       ` Re[2]: " Giuseppe Bilotta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3.0.6.32.20010219112004.0180d100@server-1 \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).