Knuth shuffle: Difference between revisions

Content added Content deleted
Line 1,096: Line 1,096:
int d[100] 'int array or any other type
int d[100] 'int array or any other type
...
...
for i=100 to 1 step-1
for i=100 to 1 step -1
j=irnd(1,100)
j=irnd(1,100)
swap d[i],d[j]
swap d[i],d[j]