Best shuffle: Difference between revisions

m
→‎{{header|REXX}}: further indented a DO loop.
m (→‎{{header|REXX}}: elided the need for a B variable in the function.)
m (→‎{{header|REXX}}: further indented a DO loop.)
Line 2,684:
x=overlay(y, overlay(a,x, lastpos(y,x)),j+1) /*fast swap of 2 characters*/
end /*j*/
do k=1 for L; a=substr(x,k,1) /*handle a possible rep. */
 
do k=1 for L; if a\==substr(xox, k, 1) then iterate /*handle a possible rep. skip non-replications*/
if a\k==substrL then x=left(oxx,k-2)a || substr(x,k-1, 1) then iterate /*skip non-replications. last case*/
if k==L then else x=left(x, k-21)a || substr(x, k-+1, 1)a || substr(x, /*last case.*/k+2)
end else x=left(x, k-1)substr(x, k+1, 1)a || substr(x, /*k+2)*/
end /*k*/
return x</lang>
'''output''' &nbsp; (with a freebie thrown in):