Skip to content

Instantly share code, notes, and snippets.

@ethanjurman
Created February 8, 2013 14:55
Show Gist options
  • Save ethanjurman/4739478 to your computer and use it in GitHub Desktop.
Save ethanjurman/4739478 to your computer and use it in GitHub Desktop.
#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