RosettaCodeData/Task/Rot-13/OCaml/rot-13-1.ml
2024-10-16 18:07:41 -07:00

4 lines
158 B
OCaml

let rot13 c = match c with
| 'A'..'M' | 'a'..'m' -> char_of_int (int_of_char c + 13)
| 'N'..'Z' | 'n'..'z' -> char_of_int (int_of_char c - 13)
| _ -> c