Mind boggling card trick: Difference between revisions
Content deleted Content added
Added Quackery. |
m →{{header|Quackery}}: tidied up |
||
Line 1,584:
=={{header|Quackery}}==
<lang Quackery> [ stack ] is discards ( --> s )▼
▲ [ stack ] is discards ( --> s )
[ stack ] is red-card ( --> s )
[ stack ] is black-card ( --> s )
[ dup take rot join swap put ] is to-pile ( n s --> )
[ $ "" discards put
Line 1,598 ⟶ 1,595:
char R 26 of
char B 26 of join shuffle
26 times
[ behead tuck discards to-pile
behead rot char R =
Line 1,607 ⟶ 1,604:
[ emit sp ] cr
red-card take
black-card take
over size over size min random
say "Swapping " dup echo
say " cards." cr
dup dip [ split rot ] split
dip
0 swap witheach
[ char R =
0 rot witheach
[ char B =
say "The assertion is "
= iff [ say "true." ]
else [ say "false." ] cr cr ] is task ( --> )
|