Hi Raul,
You might want to update the J entry on the Rosetta Code page for Rot-13 
"http://rosettacode.org/wiki/Rot-13#J"; with one of these solutions.

I'm thinking it would also be worthwhile adding a definition for rot13 to the 
convert/misc addon (or perhaps the strings script) ?

Ric

> From: Raul Miller
> 
> On Tue, Oct 20, 2009 at 2:24 PM, I wrote:
> >   rot13=:{&((65 97+/i.26)13&|."1@:[}i.256)&.(a.&i.)
> > is the same length as the K implementation
> > http://www.miranda.org/~jkominek/rot13/k/rot13.k
> >   rot13:_ci[,/@[(0 65 91 97 123)_!256;1 3;13...@_ic
> 
> But @:[ is overkill when @[ does the same thing
>     rot13=:{&((65 97+/i.26)13&|."1...@[}i.256)&.(a.&i.)
> 
> And we can can shave off another character by
> rearranging the table of letter indices
>    rot13=:{&((65 97+/~i.26)13&|....@[}i.256)&.(a.&i.)
> 
> 47 characters is not too bad.  If we wanted we could
> add back in a bit of whitespace and not be longer than
> the K approach.
> 
> --
> Raul
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to