Stable marriage problem: Difference between revisions
Content added Content deleted
(add Ruby) |
m (→{{header|Ruby}}: just modifying trace statements) |
||
Line 2,330: | Line 2,330: | ||
engage(person) |
engage(person) |
||
elsif better_choice?(person) |
elsif better_choice?(person) |
||
puts "#{self} dumps #{@fiance}" if $DEBUG |
puts "#{self} dumps #{@fiance} for #{person}" if $DEBUG |
||
@fiance.free |
@fiance.free |
||
puts "#{self} accepts proposal from #{person}" if $DEBUG |
|||
engage(person) |
engage(person) |
||
else |
else |
||
puts "#{self} rejects proposal" if $DEBUG |
puts "#{self} rejects proposal from #{person}" if $DEBUG |
||
end |
end |
||
end |
end |