RosettaCodeData/Task/Rot-13/Slope/rot-13.slope
2023-07-01 13:44:08 -04:00

16 lines
552 B
Text

(define rot-char-13 (lambda (ch)
(set! ch (string->rune ch))
(cond
(
(or
(and (>= ch (string->rune "a")) (<= ch (string->rune "m")))
(and (>= ch (string->rune "A")) (<= ch (string->rune "M"))))
(rune->string (+ ch 13)))
(
(or
(and (>= ch (string->rune "n")) (<= ch (string->rune "z")))
(and (>= ch (string->rune "N")) (<= ch (string->rune "Z"))))
(rune->string (- ch 13)))
(else (rune->string ch)))))
(display (list->string (map rot-char-13 (string->list "nowhere->ABJURER!"))))