RosettaCodeData/Task/Rot-13/Slope/rot-13.slope

17 lines
552 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(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!"))))