in reply to Array Shuffle

I've run your code a few times for the array (1, 2, 3), and it seems that it always returns (3, 2, 1), while it should return (2, 3, 1) or (3, 1, 2) so I think it doesn't do what you want.

It gives similarly wrong results for the array (1, 2, 3, 4) and gets in an infinite loop for (1, 2).