@Maker
By using that algorithm, ain't that method disturbs the original order of the array (not that this does not appeal to the thread's topic) ?
Let's say we have 5 values from a single array;
Number[1] = 1
Number[2] = 2
...
Number[5] = 5
The order would be: 1, 2, 3, 4, 5.
Let's take your algorithm into actions and let's say the random is 3, therefore;
Number[3] is 3, right ?
Then;
Number[3] = Number[5] (since 5 is the max)
The order now would be;
1, 2, 5, 4, 5.
Then;
Max = Max - 1
The order now would be;
1, 2, 5, 4.
Is this the correct tracing of values, right ?