Skip to content

Instantly share code, notes, and snippets.

@alketii
Created June 3, 2015 10:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alketii/b0715d961dc66550955a to your computer and use it in GitHub Desktop.
Save alketii/b0715d961dc66550955a to your computer and use it in GitHub Desktop.
array shuffle
func shuffle(array):
randomize()
var shuffeled = []
var current
var count = array.size()
for i in range(0,count):
current = randi()%array.size()
shuffeled.append(array[current])
array.remove(current)
return shuffeled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment