Jump to content

Rot-13: Difference between revisions

711 bytes added ,  12 years ago
no edit summary
No edit summary
No edit summary
Line 41:
.storeit sta (buffer),y
jmp next</lang>
 
=={{header|ACL2}}==
<lang lisp>(include-book "arithmetic-3/top" :dir :system)
 
(defun char-btn (c low high)
(and (char>= c low)
(char<= c high)))
 
(defun rot-13-cs (cs)
(cond ((endp cs) nil)
((or (char-btn (first cs) #\a #\m)
(char-btn (first cs) #\A #\M))
(cons (code-char (+ (char-code (first cs)) 13))
(rot-13-cs (rest cs))))
((or (char-btn (first cs) #\n #\z)
(char-btn (first cs) #\N #\Z))
(cons (code-char (- (char-code (first cs)) 13))
(rot-13-cs (rest cs))))
(t (cons (first cs) (rot-13-cs (rest cs))))))
 
(defun rot-13 (s)
(coerce (rot-13-cs (coerce s 'list)) 'string))</lang>
 
=={{header|Ada}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.