Hello Karl Robillard (krobillard),
Your Version is very Small but not a fully ROT13!
Rot13 may only convert a - z A - Z
Your version also converts anyother character (byte) too, so it wont work on binary
strings..
This though works fine in a foreach loop (below), I believe it can be smaller,
but i could not manage it to get it smaller after headbreaking ;-)
rot13: func [ char [char!] { returns a rotate 13 on alphanumeric charatcers } ] [
char: to-char char
if any [ all [ char >= #"a" char <= #"m" ] all [ char >= #"A" char <= #"M" ] ] [
return char + 13 ]
if any [ all [ char >= #"n" char <= #"z" ] all [ char >= #"N" char <= #"Z" ] ] [
return char - 13 ]
return char
]
(R)egards, Norman.
--
Conversation/lunch: "How do you Eat your Rebol in the Morning?"
--
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.