Card shuffles: Difference between revisions
Content added Content deleted
m (J: simplify overhand shuffle) |
|||
Line 156: | Line 156: | ||
<lang J>NB. cut rotates the deck to an arbitrary position |
<lang J>NB. cut rotates the deck to an arbitrary position |
||
overhand=: |
overhand=: (\: [: +/\ %@%:@# > # ?@# 0:)@]^:[ |
||
NB. Gilbert–Shannon–Reeds model |
NB. Gilbert–Shannon–Reeds model |
||
Line 170: | Line 170: | ||
6 10 13 8 2 14 15 9 19 3 18 16 11 1 12 17 5 4 0 7 |
6 10 13 8 2 14 15 9 19 3 18 16 11 1 12 17 5 4 0 7 |
||
1 overhand i.20 |
1 overhand i.20 |
||
17 18 19 14 15 16 |
17 18 19 13 14 15 16 4 5 6 7 8 9 10 11 12 0 1 2 3 |
||
10 overhand i.20 |
10 overhand i.20 |
||
15 11 2 4 5 12 16 10 17 19 9 8 6 13 3 18 7 1 0 14</lang> |
|||
=={{header|Java}}== |
=={{header|Java}}== |