Swift: That Permutation Generator thing It’s been tantalizing me all week, so I leave you with this for the weekend View the code on Gist. Share this:Click to share on Twitter (Opens in new window)Click to share on Facebook (Opens in new window) Related April 24, 2015 By erica Development, Swift 2 Comments Tweet this Post Swift: Convert a sequence to an arraySwift: Convert a sequence to an array
2 Comments
I’d suggest doing it lazily: https://gist.github.com/glessard/7140fe885af3eb874e11
Seeing as this is one of the top results when searching for PermutationGenerator, I updated it for Swift 2.0 here: https://gist.github.com/scottrhoyt/3e877bb10fcc687f6068#file-randomgenerator-swift