Dinesman's multiple-dwelling problem: Difference between revisions

Content deleted Content added
Bartj (talk | contribs)
→‎{{header|Bracmat}}: Corrected error
Line 10: Line 10:


=={{header|Bracmat}}==
=={{header|Bracmat}}==

{{Incorrect|Bracmat|Solution lists residents in alphabetic order with no indication of who is on which floor.}}
<lang Bracmat>( Baker Cooper Fletcher Miller Smith:?people
<lang Bracmat>( Baker Cooper Fletcher Miller Smith:?people
& ( constraints
& ( constraints
Line 25: Line 25:
= floors persons A Z person
= floors persons A Z person
. !arg:(?floors.?persons)
. !arg:(?floors.?persons)
& ( !persons:&constraints$!floors
& ( !persons:
& constraints$!floors
& out$("Inhabitants, from bottom to top:" !floors)
| !persons
| !persons
: ?A
: ?A
Line 33: Line 35:
)
)
& solution$(.!people)
& solution$(.!people)
&
)
</lang>
);</lang>
<lang>Baker Cooper Fletcher Miller Smith</lang>
<lang>Inhabitants, from bottom to top: Smith Cooper Baker Fletcher Miller</lang>


=={{header|C}}==
=={{header|C}}==