Skip to content

Instantly share code, notes, and snippets.

@antoniobg
Created September 10, 2014 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoniobg/71eabc99ca4c6f583153 to your computer and use it in GitHub Desktop.
Save antoniobg/71eabc99ca4c6f583153 to your computer and use it in GitHub Desktop.
def build_array
participants = []
file = File.open("participantes.csv")
file.each do |line|
participants << line
end
participants
end
def get_winner(participants)
puts participants[rand(0..participants.length)]
end
get_winner(build_array)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment