Knuth shuffle: Difference between revisions

 
Line 5,218:
Build pairs of indexes to be swapped then apply these as a fold.
<syntaxhighlight lang="Uiua">
Knuth ← ∧(⍜⊏⇌)(⊟⌊×⚂.)⇌↘1⇡⧻. ⇡10
Knuth ⇡10
</syntaxhighlight>
Typical output:
<pre>
[3 0 6 5 7 8 4 1 9 2]
</pre>
 
=={{header|UNIX Shell}}==
60

edits