Created
February 8, 2013 14:55
-
-
Save ethanjurman/4739478 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
#birthday.rb | |
birthdays_taken = [] | |
doubles = false | |
while( !doubles ) do | |
if birthdays_taken.include?(y=rand(365)) | |
doubles = true | |
end | |
birthdays_taken << y | |
end | |
puts birthdays_taken.size | |
print birthdays_taken |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment