Created
October 18, 2021 14:19
-
-
Save cemolcay/c19c2e220b593f490fd6a1c9beb38a86 to your computer and use it in GitHub Desktop.
creates fractal sequence
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
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