include comment about sample method
This commit is contained in:
parent
ca8ffc44b5
commit
85c881c1c8
|
|
@ -29,7 +29,7 @@ pick_order = participants.shuffle
|
||||||
pick_order.each do |participant|
|
pick_order.each do |participant|
|
||||||
|
|
||||||
while participant.buys_for == nil
|
while participant.buys_for == nil
|
||||||
pick = hat[rand(hat.length)]
|
pick = hat[rand(hat.length)] # could use hat.sample instead, the sample method randomly picks from an array.
|
||||||
puts "#{participant.name} picks #{pick.name}"
|
puts "#{participant.name} picks #{pick.name}"
|
||||||
unless pick == participant
|
unless pick == participant
|
||||||
participant.buys_for = pick
|
participant.buys_for = pick
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue