Skip to content

Instantly share code, notes, and snippets.

@cemolcay
Created October 18, 2021 14:19
Show Gist options
  • Save cemolcay/c19c2e220b593f490fd6a1c9beb38a86 to your computer and use it in GitHub Desktop.
Save cemolcay/c19c2e220b593f490fd6a1c9beb38a86 to your computer and use it in GitHub Desktop.
creates fractal sequence
import UIKit
import XCPlayground
// 500-1000, 1-100
func seq(length: Int, sampleRate: Int) -> [Int] {
var s = [Int]()
for i in 0..<length {
s.append((i * sampleRate).nonzeroBitCount)
}
return s
}
seq(length: 50, sampleRate: 37).map({ $0 })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment