Dinesman's multiple-dwelling problem: Difference between revisions

Content added Content deleted
m (→‎{{header|Quackery}}: tweaked text, removed superfluous code)
Line 3,911: Line 3,911:
fletcher cooper adjacent exclude</pre>
fletcher cooper adjacent exclude</pre>


Is 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.
is 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.
::* &nbsp; Baker does not live on the top floor.
Line 3,923: Line 3,923:
<code>permutations</code> is defined at [[Permutations#Quackery]].
<code>permutations</code> is defined at [[Permutations#Quackery]].


<syntaxhighlight lang="Quackery"> [ temp share 0 peek ] is baker ( --> n )
<syntaxhighlight lang="Quackery"> [ stack ] is problem ( --> s )

[ temp share 0 peek ] is baker ( --> n )
[ temp share 1 peek ] is cooper ( --> n )
[ temp share 1 peek ] is cooper ( --> n )
[ temp share 2 peek ] is fletcher ( --> n )
[ temp share 2 peek ] is fletcher ( --> n )
Line 3,938: Line 3,940:
[ temp share nested join ] is include ( [ --> [ )
[ temp share nested join ] is include ( [ --> [ )


[ ]'[ ' include join
[]
problem put
' [ 1 2 3 4 5 ] permutations
[]
witheach
[ temp put
' [ 1 2 3 4 5 ]
permutations
[ baker top exclude
witheach
cooper bottom exclude
fletcher top
[ temp put
fletcher bottom or exclude
problem share do
miller cooper higher require
temp release ]
problem release
smith fletcher adjacent exclude
fletcher cooper adjacent exclude
say " B C F M S" cr
witheach [ echo cr ] ] 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}}
{{out}}