Saw a rot13 inREBOL at http://ucsub.colorado.edu/~kominek/rot13/rebol/

Thought it unduly complicated so gave it a try myself.

Here's my solution. Any improvements?

REBOL [
        Title: "Rot13"
        Author: "Stephen B. Coulson"
        Purpose: {To do a classic rot13 of course}
]

table: "nopqrstuvwxyzabcdefghijklmnopqrstuvwxyzNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ"
rot13: func [target/local char][target: "" either error? try [table: skip find/case 
head table char 13][append target char][append target first table]]
rotme: ask "Type the string to rot :"
print foreach letter rotme [rot13 letter]


--
+ _                     /^^      (   Stephen B. Coulson            )   +
|(_ [_  _  _ [_  _  _   |OO   O (  e-mail: [EMAIL PROTECTED]      ) |
|,_)[_ (-'[_)[ )(-'[ )  @ \  o  ( http://members.axion.net/~scoulson ) |
+       ~ [      ~      |o~ .                                          +

Reply via email to