Skip to content

Instantly share code, notes, and snippets.

@LisaBee224
Created April 15, 2016 03:43
Show Gist options
  • Save LisaBee224/c65099fe29d38228a4a6bdbae70fe1c1 to your computer and use it in GitHub Desktop.
Save LisaBee224/c65099fe29d38228a4a6bdbae70fe1c1 to your computer and use it in GitHub Desktop.
def shuffle(array)
comp_array = array.dup
random_nums = []
until random_nums.length == array.length
j = rand(array.length)
if !random_nums.include?(j)
random_nums << j
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment