Jump to content

Dinesman's multiple-dwelling problem: Difference between revisions

m (→‎{{header|Quackery}}: tweaked text, removed superfluous code)
Line 3,911:
fletcher cooper adjacent exclude</pre>
 
Isis a restatement of the conditions of the problem (1) with noise words removed, (2) in postfix notation, and (3) recast as imperative rather than declarative.
 
::* &nbsp; Baker does not live on the top floor.
Line 3,923:
<code>permutations</code> is defined at [[Permutations#Quackery]].
 
<syntaxhighlight lang="Quackery"> [ tempstack share] 0 peek ] is baker is problem ( --> ns )
 
[ temp share 0 peek ] is baker ( --> n )
[ temp share 1 peek ] is cooper ( --> n )
[ temp share 2 peek ] is fletcher ( --> n )
Line 3,938 ⟶ 3,940:
[ temp share nested join ] is include ( [ --> [ )
 
[ ]'[ ' include ]join
[]
problem put
' [ 1 2 3 4 5 ] permutations
[]
witheach
' [ temp1 2 3 4 5 put]
' [ 1 2 3 4 5 ] permutations
[ baker top exclude
witheach
cooper bottom exclude
[ temp fletcher topput
fletcherproblem bottomshare or excludedo
millertemp cooperrelease higher require]
tempproblem release ]
smith fletcher adjacent exclude
say " B fletcherC cooperF adjacentM excludeS" cr
witheach [ echo cr ]</syntaxhighlight ] is solve ( --> )
include ]
 
temp release ]
solve
say " B C F M S" cr
[ baker top exclude
witheach [ echo cr ]</syntaxhighlight>
cooper bottom exclude
fletcher top
fletcher bottom or exclude
miller cooper higher require
smith fletcher adjacent exclude
fletcher cooper adjacent exclude ]</syntaxhighlight>
 
{{out}}
1,493

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.