prism/examples/prism-hoon.html

17 lines
268 B
HTML

<h2>Caesar cipher</h2>
<pre><code>|= [a=@ b=tape]
^- tape
?: (gth a 25)
$(a (sub a 26))
%+ turn b
|= c=@tD
?: &((gte c 'A') (lte c 'Z'))
=. c (add c a)
?. (gth c 'Z') c
(sub c 26)
?: &((gte c 'a') (lte c 'z'))
=. c (add c a)
?. (gth c 'z') c
(sub c 26)
c</code></pre>