Stable marriage problem: Difference between revisions

Content added Content deleted
(→‎{{header|Python}}: Clarification to stability check message.)
(Fixed diagnostic message)
Line 686: Line 686:


=={{header|PicoLisp}}==
=={{header|PicoLisp}}==
{{incorrect|PicoLisp|checkCouples routines output is not clear}}
<lang PicoLisp>(setq
<lang PicoLisp>(setq
*Boys (list
*Boys (list
Line 738: Line 737:
(cdr (asoq B *Couples)) # and B prefers Girl
(cdr (asoq B *Couples)) # and B prefers Girl
(cdr (memq Girl (val B))) )
(cdr (memq Girl (val B))) )
(prinl Girl " likes " B " better than " Boy) ) )
(prinl
Girl " likes " B " better than " Boy " and "
B " likes " Girl " better than "
(cdr (asoq B *Couples)) ) ) )
(val Girl) ) ) )
(val Girl) ) ) )
*Couples )
*Couples )
Line 763: Line 765:


Engage fred with abi and jon with bea
Engage fred with abi and jon with bea
fay likes jon better than dan
fay likes jon better than dan and jon likes fay better than bea
eve likes jon better than hal
eve likes jon better than hal and jon likes eve better than bea
gay likes jon better than gav
gay likes jon better than gav and jon likes gay better than bea
bea likes fred better than jon</pre>
bea likes fred better than jon and fred likes bea better than abi</pre>


=={{header|Python}}==
=={{header|Python}}==