core :: Collection :: to_shuffle
var a = [1,2,1].to_shuffle assert a == [1,1,2] or a == [1,2,1] or a == [2,1,1]
# Return a new array made of elements in a random order. # # ~~~ # var a = [1,2,1].to_shuffle # assert a == [1,1,2] or a == [1,2,1] or a == [2,1,1] # ~~~ fun to_shuffle: Array[E] do var res = self.to_a res.shuffle return res end