Best shuffle: Difference between revisions

m (→‎{{header|REXX}}: added whitespace, allowed input from command line, split up multiple lines, added/changed comments, undented subroutine fences. -- ~~~~)
Line 1,057:
 
auto bestShuffle(S)(in S orig) if (isSomeString!S) {
auto s = to!(dchar[])(o.dup);
static if (isNarrowString!S)
auto o = to!dstring(orig);
else alias orig o;
 
auto s = o.dup;
randomShuffle(s);
foreach (i, ref ci; s) {
Anonymous user