Skip to content

Instantly share code, notes, and snippets.

View a40yostudent's full-sized avatar
🤓
Learning computer science

A 40 years old student a40yostudent

🤓
Learning computer science
View GitHub Profile
@a40yostudent
a40yostudent / Brun.swift
Created January 3, 2023 16:16
Calculate Brun’s constant
@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
@a40yostudent
a40yostudent / .gitignore
Created January 16, 2017 15:53
decent .gitignore for Xcode found somewhere
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
/*
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 {