Created
January 29, 2015 16:09
-
-
Save jarsen/2605446c05e4e0ddc125 to your computer and use it in GitHub Desktop.
why does this crash?
This file contains hidden or 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
func eratosthenes(n: Int) -> [Int]{ | |
return map(enumerate(Array(1...n))) { (index, number) in | |
if number % index == 0 { | |
return -1 | |
} | |
else { | |
return number | |
} | |
} | |
} | |
eratosthenes(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment