retroforth/example/rot13.forth

7 lines
151 B
Text
Raw Normal View History

~~~
:MAP (-s) 'nopqrstuvwxyzabcdefghijklm ;
:encode (c-c) $a - MAP + fetch ;
:rot13 (s-s) s:to-lower [ dup c:letter? [ encode ] if ] s:map ;
~~~