; caesar cipher
(define (caesar n str)
(define (char-plus c)
(let ((alpha "ABCDEFGHIJKLMNOPQRSTUVWXYZ"))
(if (not (char-alphabetic? c)) c
(let ((i (- (char->integer (char-upcase c)) 65)))
(string-ref alpha (modulo (+ i n) 26))))))
(list->string (map char-plus (string->list str))))
(display (caesar 3 "PROGRAMMINGPRAXIS")) (newline)
(display (caesar -3 "SURJUDPPLQJSUDALV")) (newline)