22 lines
537 B
Text
22 lines
537 B
Text
; rot-13.xom
|
|
global stream gs-phrase
|
|
|
|
define stream function apply-rot-13 (value stream phrase) as
|
|
local integer b
|
|
local stream ciphered
|
|
open ciphered as buffer
|
|
repeat scan phrase
|
|
match letter => char
|
|
set b to char binary 0
|
|
increment b by 13
|
|
decrement b by 26 when char matches uc and b > 90
|
|
decrement b by 26 when char matches lc and b > 122
|
|
put ciphered "b" % b
|
|
match any => char
|
|
put ciphered char
|
|
again
|
|
close ciphered
|
|
return ciphered
|
|
|
|
process
|
|
output apply-rot-13(gs-phrase)
|