Card shuffles: Difference between revisions

add PicoLisp
(Added Kotlin)
(add PicoLisp)
Line 607:
KS AS JS QS TS AD 8S 9S 9D TD JD QD KD QC KC AC 8D AH 8C 9C TC JC JH QH KH TH 8H 9H
KH TH AH QH 8D JC QC 8C JH 8H 9D KS TD AS KD 8S TC AD TS AC 9C KC 9H QD JD JS 9S QS
</pre>
 
=={{header|PicoLisp}}==
<lang PicoLisp>(load "@lib/simul.l")
 
(de riffle (Lst)
(let N (/ (setq @@ (length Lst)) 2)
(conc
(mapcan list (head N Lst) (tail (- N) Lst))
(and (bit? 1 @@) (tail 1 Lst)) ) ) )
(de overhand (Lst)
(let N (/ (* (length Lst) 20) 100)
(make
(while (flip (cut N 'Lst))
(for I @
(yoke I) ) ) ) ) )
 
(println 'riffle (riffle (range 1 19)) )
(println 'overhand (overhand (range 1 19)) )
(println 'shuffle (shuffle (range 1 19)) )</lang>
{{out}}
<pre>
riffle (1 10 2 11 3 12 4 13 5 14 6 15 7 16 8 17 9 18 19)
overhand (19 16 17 18 13 14 15 10 11 12 7 8 9 4 5 6 1 2 3)
shuffle (5 3 13 15 17 12 14 11 2 1 19 7 6 9 18 8 10 4 16)
</pre>
 
298

edits