Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
9
Task/Rot-13/F-Sharp/rot-13.fs
Normal file
9
Task/Rot-13/F-Sharp/rot-13.fs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
let rot13 (s : string) =
|
||||
let rot c =
|
||||
match c with
|
||||
| c when c > 64 && c < 91 -> ((c - 65 + 13) % 26) + 65
|
||||
| c when c > 96 && c < 123 -> ((c - 97 + 13) % 26) + 97
|
||||
| _ -> c
|
||||
s |> Array.of_seq
|
||||
|> Array.map(int >> rot >> char)
|
||||
|> (fun seq -> new string(seq))
|
||||
Loading…
Add table
Add a link
Reference in a new issue