Created
April 15, 2016 03:43
-
-
Save LisaBee224/c65099fe29d38228a4a6bdbae70fe1c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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