Anonymous user
Best shuffle: Difference between revisions
→{{header|D}}
(→{{header|D}}: more concise) |
|||
Line 634:
auto s = o.dup;
randomShuffle(s);
foreach (i, ref ci; s)
foreach (j, ref cj; s)
if (
swap(ci, cj);
break;
|