Skip to content

Instantly share code, notes, and snippets.

@bkleinen
Created October 8, 2013 13:27
Show Gist options
  • Save bkleinen/6884624 to your computer and use it in GitHub Desktop.
Save bkleinen/6884624 to your computer and use it in GitHub Desktop.
Random numbers for IMI Project Assignment.
Fire up irb and copy those two lines:
number_of_students=19
s = Set.new; n = 0 ; s << 0
Then repeatedly call this to get the next student:
while (s.include? n) do n = rand(number_of_students)+1 end ; s << n ; puts s.inspect ; n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment