Dutch national flag problem: Difference between revisions
→{{header|Quackery}}: tweakage
(Added Quackery.) |
(→{{header|Quackery}}: tweakage) |
||
Line 3,379:
[ 3 ] is blue ( --> n )
[ true swap
behead do swap
witheach
[ do tuck > if
[ dip not
conclude ] ]
drop ] is sorted ( [ --> b )
[] ' [ red white blue ]
witheach
[ swap
nip ]
▲ [] 4 random 1+ times [ ' red nested join ]
▲ 4 random 1+ times [ ' blue nested join ]
▲ [ shuffle dup sorted not until ]
say "Before sorting: " dup echo cr
say " After sorting: " sortwith [ dip do do > ] echo cr</syntaxhighlight>
|