Return to Snippet

Revision: 9847
at November 25, 2008 17:18 by egreg1968


Initial Code
# 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

Initial URL


Initial Description


Initial Title
The Naughty Algorithm

Initial Tags
textmate

Initial Language
Other