lundi 14 septembre 2015

Choose unique random number from an array

b is the maximum winner that I want.

b.times do
  winner = participant[rand(participant.count)]
end

I need to generate a unique winner every time. How can I achieve this without making too many changes to this code?




Aucun commentaire:

Enregistrer un commentaire