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
@main | |
public struct Brun { | |
static let primesLength = 100000000 | |
public static func main() { | |
// proven that all primes are in the form '6k +/- 1' | |
// this is a switch to advance the candidate of +2 or +4, to be xored with 1 every loop. | |
var form_6k_pm1 = false | |
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
# Xcode | |
# | |
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore | |
## Build generated | |
build/ | |
DerivedData/ | |
## Various settings | |
*.pbxuser |
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
/* | |
Convenient way to enumerate an enum, see also: | |
http://www.swift-studies.com/blog/2014/6/10/enumerating-enums-in-swift | |
http://www.wooji-juice.com/blog/stupid-swift-tricks-5-enums.html | |
https://gist.github.com/erica/b849cef7fcd123756373 | |
Sabino Paulicelli | |
*/ | |
protocol SmartEnum { |