Rot13 (Scheme)

From LiteratePrograms
Jump to: navigation, search
Other implementations: Haskell | Java | Python | Scheme | Sed

This program is a code dump.
Code dumps are articles with little or no documentation or rearrangement of code. Please help to turn it into a literate program. Also make sure that the source of this code does consent to release it under the CC0 license.


<<char-rot13>>=
(define (char-rot13 c)
  (if (and (char-ci>=? c #\a) (char-ci<=? c #\z))
      (integer->char ((if (char-ci<=? c #\m) + -) (char->integer c) 13))
      c))
<<string-rot13>>=
(define (string-rot13 s)
  (list->string (map char-rot13 (string->list s))))
Download code
hijacker
hijacker
hijacker
hijacker