Skip to content

Instantly share code, notes, and snippets.

@cajun-code
Last active January 4, 2016 18:19
Show Gist options
  • Save cajun-code/8660128 to your computer and use it in GitHub Desktop.
Save cajun-code/8660128 to your computer and use it in GitHub Desktop.
Rand Number Generator
#require "random"
print "Enter the number of guests:"
guests = gets()
print "Enter the number of prizes to give away:"
prizes = gets()
winners = []
prizes.to_i.times do
winner = Random.rand guests.to_i
while winners.include?(winner) # add if gap in number blocks winner > 29 and winner < 58
winner = Random.rand guests.to_i
end
puts("The Winner is ##{winner}")
10000.times{}
winners << winner
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment