Skip to content

Instantly share code, notes, and snippets.

@matiasgarciaisaia
Created April 4, 2017 20:27
Show Gist options
  • Save matiasgarciaisaia/0afbbde3a799d596f9188d42dfb4e50f to your computer and use it in GitHub Desktop.
Save matiasgarciaisaia/0afbbde3a799d596f9188d42dfb4e50f to your computer and use it in GitHub Desktop.
participants = [
"Bugs Bunny (@bugsbunny)",
"Duffy Duck (@duffyduck)",
"Porky Pig (@porkypig)"
]
participants.size
WINNERS_SIZE = 2
raise "Everybody wins! Congrats to \
#{participants.join(", ")}" if
WINNERS_SIZE >= participants.size
winners = [] of String
WINNERS_SIZE.times do
winner = participants.sample
participants.delete winner
winners << winner
end
puts "Thank you all for participating and supporting @CrystalLanguage.
Today's #{WINNERS_SIZE} lucky winners are: \n\n#{winners.join("\n")}\n
Please reach us on Twitter so we can send you your stickers!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment