On Oct 3, 2004, at 6:24 AM, Robo wrote:
>   #filter out people who're in the same family as Secret Santa
>   def filter(santa)
>     @pool.select do |member|
>       member.lastName != santa.lastName
>     end
>   end

Very nice, Robo. Whenever I've thought of "random except for ____" type 
solutions, I've never gotten beyond thinking of "keep picking random 
items until you meet the criteria" (which is a dumb way to go about 
it).

Filtering the pool is quite nice.

Hrm, which gives me a good idea for my Ouroboros#separate_duplicates 
method; currently if I find a family duplicate I just swap the second 
one with it's following neighbor, and either hope that it's not the 
same family or wait until the next pass in the loop to fix that one. I 
suspect I would get much quicker sorting if I 'filtered' the 
pool...search ahead for the next person who isn't in the same family 
and swap them.

That smells like it should be an O(n) performer, rather than ~O(n^2).

--
(-, /\ \/ / /\/