Created
September 10, 2014 10:59
-
-
Save antoniobg/71eabc99ca4c6f583153 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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