Card shuffles: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(One intermediate revision by one other user not shown)
Line 1,142:
def iterations: 10;
 
"Starting deck:",
| "Starting deck:",
"Riffle shuffle with \(iterations) iterations:",
riffle(deck; "Riffle shuffle with \(iterations) iterations:",
"\nOverhand shuffle with \riffle(iterations) iterations:",
"Riffle\nOverhand shuffle with \(iterations) iterations:",
overhand(deck; iterations),
"\nStandard library shuffle with 1 iteration:",
(deck | knuthShuffle) # shuffles deck in place
knuthShuffle
</syntaxhighlight>
{{output}}
Line 2,501 ⟶ 2,502:
=={{header|Wren}}==
{{trans|Kotlin}}
<syntaxhighlight lang="ecmascriptwren">import "random" for Random
 
var r = Random.new()
Line 2,580 ⟶ 2,581:
[9, 16, 2, 12, 8, 20, 13, 5, 4, 18, 17, 6, 11, 19, 1, 3, 14, 7, 10, 15]
</pre>
 
=={{header|zkl}}==
A much better shuffle is List's shuffle method.
9,482

edits