Skip to content

Instantly share code, notes, and snippets.

@JRJurman
Forked from ethanjurman/gist:4739478
Last active December 12, 2015 07:49
Show Gist options
  • Save JRJurman/4739523 to your computer and use it in GitHub Desktop.
Save JRJurman/4739523 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