include comment about sample method

This commit is contained in:
James 2025-06-25 15:18:23 -05:00
parent ca8ffc44b5
commit 85c881c1c8

View file

@ -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