Posted By

egreg1968 on 11/25/08


Tagged

textmate Snata Claue


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

chippper


The Naughty Algorithm


 / Published in: Other
 

  1. # loop through all of humanity
  2. humanity.each do |human|
  3.  
  4. # select out a set of presents for this human
  5. presents = santas_bag.select do |gift|
  6. good_enough = list.is_good_enough_for_this_gift?(human, gift)
  7. if (!good_enough) # better check twice
  8. good_enough = list.is_good_enough_for_this_gift?(human, gift)
  9. return good_enough
  10. end
  11.  
  12. santa.leave presents
  13. end

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: chippper on December 2, 2008

awesome. just awesome.

You need to login to post a comment.