顽皮的算法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了顽皮的算法相关的知识,希望对你有一定的参考价值。
# 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
以上是关于顽皮的算法的主要内容,如果未能解决你的问题,请参考以下文章