Jump to content

Dinesman's multiple-dwelling problem: Difference between revisions

Line 146:
 
=={{header|Icon}} and {{header|Unicon}}==
This solution uses string invocation to call operators and the fact the Icon/Unicon procedures are first class values. The procedure names could also be given as strings and it would be fairly simple to read the names and all the rules directly from a file. Each name and rule recurses and relies on the inherent backtracking in the language to achieve the goal.
 
<lang Icon>invocable all
global nameL, nameT, rules
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.