Created
October 8, 2013 13:27
-
-
Save bkleinen/6884624 to your computer and use it in GitHub Desktop.
Random numbers for IMI Project Assignment.
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
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