Dinesman's multiple-dwelling problem: Difference between revisions

Content added Content deleted
(→‎Tcl: Added implementation)
m (→‎{{header|Tcl}}: Some notes)
Line 686: Line 686:


=={{header|Tcl}}==
=={{header|Tcl}}==
It's trivial to extend this problem to deal with more floors and people and more constraints; the main internally-generated constraint is that the names of people should begin with an upper case character so that they are distinct from internal variables. This code also relies on the caller encoding the conditions as expressions that produce a value that is/can be interpreted as a boolean.
{{tcllib|struct::list}}
{{tcllib|struct::list}}
<lang tcl>package require Tcl 8.5
<lang tcl>package require Tcl 8.5