Set consolidation: Difference between revisions
Content deleted Content added
Added Quackery. |
m →{{header|Quackery}}: simplified code |
||
Line 2,298: | Line 2,298: | ||
=={{header|Quackery}}== |
=={{header|Quackery}}== |
||
<syntaxhighlight lang="Quackery"> |
<syntaxhighlight lang="Quackery"> |
||
[ 0 swap witheach [ bit | ] ] is ->set ( $ --> { ) |
|||
[ say "{" 0 swap |
[ say "{" 0 swap |
||
Line 2,305: | Line 2,306: | ||
[ over emit ] |
[ over emit ] |
||
1 >> dip 1+ again ] |
1 >> dip 1+ again ] |
||
2drop say "} " ] |
2drop say "} " ] is echoset ( { --> ) |
||
[ dup size 2 < if done |
[ dup size 2 < if done |
||
[ dup size 1 - times |
[ dup size 1 - times |
||
[ |
[ behead over |
||
behead over |
|||
witheach |
witheach |
||
[ 2dup & iff |
[ 2dup & iff |
||
[ | swap i^ poke |
[ | swap i^ poke |
||
[] conclude ] |
|||
conclude ] |
|||
else drop ] |
else drop ] |
||
join ] ] ] is consolidate ( [ --> [ ) |
|||
[ dup witheach echoset |
[ dup witheach echoset |
||
say "--> " |
say "--> " |
||
consolidate witheach echoset |
consolidate witheach echoset |
||
cr ] |
cr ] is task ( [ --> ) |
||
$ "AB" ->set |
$ "AB" ->set |