Dinesman's multiple-dwelling problem: Difference between revisions

Added Quackery.
(Added various BASIC dialects (Chipmunk Basic, QBasic and True BASIC))
(Added Quackery.)
Line 3,898:
{{Out}}
<pre>Baker in 3, Cooper in 2, Fletcher in 4, Miller in 5, Smith in 1.</pre>
 
=={{header|Quackery}}==
 
<code>permutations</code> is defined at [[Permutations#Quackery]]/
 
<syntaxhighlight lang="Quackery"> [ temp share 0 peek ] is baker ( --> n )
[ temp share 1 peek ] is cooper ( --> n )
[ temp share 2 peek ] is fletcher ( --> n )
[ temp share 3 peek ] is miller ( --> n )
[ temp share 4 peek ] is smith ( --> n )
 
[ 5 = ] is top ( n --> b )
[ 1 = ] is bottom ( n --> b )
[ > ] is above ( n n --> b )
[ - abs 1 = ] is adjacent ( n n --> b )
 
[ if ]done[ ] is exclude ( b --> )
[ temp share nested join ] is include ( [ --> [ )
 
[]
' [ 1 2 3 4 5 ] permutations
witheach
[ temp put
[ baker top exclude
cooper bottom exclude
fletcher top
fletcher bottom or exclude
cooper miller above exclude
smith fletcher adjacent exclude
fletcher cooper adjacent exclude
include ]
temp release ]
say " B C F M S" cr
witheach [ echo cr ]</syntaxhighlight>
 
{{out}}
 
<pre> B C F M S
[ 3 2 4 5 1 ]
</pre>
 
=={{header|R}}==
1,491

edits