/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# loop through all of humanity humanity.each do |human| # select out a set of presents for this human presents = santas_bag.select do |gift| good_enough = list.is_good_enough_for_this_gift?(human, gift) if (!good_enough) # better check twice good_enough = list.is_good_enough_for_this_gift?(human, gift) return good_enough end santa.leave presents end