Skip to content

Instantly share code, notes, and snippets.

@ryancurtin
Created May 7, 2012 16:46
Show Gist options
  • Save ryancurtin/2628898 to your computer and use it in GitHub Desktop.
Save ryancurtin/2628898 to your computer and use it in GitHub Desktop.
Randomly Display Elements from Array
x = %w(a b c d e)
x.cycle(x.length) do
y = x.sample
p y
x.delete(y)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment