Skip to content

Instantly share code, notes, and snippets.

View ihomway's full-sized avatar
🎯
Focusing

puer ihomway

🎯
Focusing
View GitHub Profile
@ihomway
ihomway / LinearConguentialGenerator.swift
Created July 9, 2019 08:10
linear congruential generator
protocol RandomNumberGenerator {
func random() -> Double
}
class LinearConguentialGenerator: RandomNumberGenerator {
var lastRandom = 42
let m = 139968.0
let a = 3877.0
let c = 29573.0