Card shuffles: Difference between revisions

m
J: simplify overhand shuffle
m (J: simplify overhand shuffle)
Line 156:
 
<lang J>NB. cut rotates the deck to an arbitrary position
overhand=: ;@|.@(<;.1~\: 1[: , 1 }.+/\ %@%:@# > # ?@# 0:)@]^:[
 
NB. Gilbert–Shannon–Reeds model
Line 170:
6 10 13 8 2 14 15 9 19 3 18 16 11 1 12 17 5 4 0 7
1 overhand i.20
17 18 19 13 14 15 16 11 12 13 0 1 2 3 4 5 6 7 8 9 10 11 12 0 1 2 3
10 overhand i.20
6 0 18 7 9 15 1911 172 104 5 12 16 110 1117 1219 9 8 6 13 143 418 27 31 0 14</lang>
 
=={{header|Java}}==
6,951

edits