28 lines
637 B
Plaintext
28 lines
637 B
Plaintext
alias rot13 [
|
|
push alpha [
|
|
"A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
|
|
"a b c d e f g h i j k l m n o p q r s t u v w x y z"
|
|
] [ push chars [] [
|
|
loop i (strlen $arg1) [
|
|
looplist n $alpha [
|
|
if (! (listlen $chars)) [
|
|
alias chars (? (> (listindex $n (substr $arg1 $i 1)) -1) $n [])
|
|
]
|
|
]
|
|
alias arg1 (
|
|
concatword (substr $arg1 0 $i) (
|
|
? (listlen $chars) (
|
|
at $chars (
|
|
mod (+ (
|
|
listindex $chars (substr $arg1 $i 1)
|
|
) 13 ) (listlen $chars)
|
|
)
|
|
) (substr $arg1 $i 1)
|
|
) (substr $arg1 (+ $i 1) (strlen $arg1))
|
|
)
|
|
alias chars []
|
|
]
|
|
] ]
|
|
result $arg1
|
|
]
|