Created
August 12, 2012 06:30
-
-
Save pocketberserker/3330153 to your computer and use it in GitHub Desktop.
素数のときにJOJO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isPrime = function | |
| n when n < 2 -> false | |
| n -> [2 .. n-1] |> List.forall ((%) n >> (<>) 0) | |
[0..100] | |
|> List.map (fun x -> if isPrime x then "JOJO!" else string x) | |
|> List.iter (printfn "%s") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment