Tuple shuffle in Swift
Contents
Tuple shuffle exists in Swift.
1 |
var a = "one", b = "two" |
1 |
var items = ["one", "two", "three"] |
With an example of array shuffle using Fisher-Yates
, let’s leverage tuple shuffle instead of swap
1 |
extension CollectionType { |