RosettaCodeData/Task/Knuth-shuffle/OxygenBasic/knuth-shuffle.basic

11 lines
156 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
uses chaos
uses timeutil
seed=GetTickCount
int i,j
int d[100] 'int array or any other type
...
for i=100 to 1 step -1
j=irnd(1,100)
swap d[i],d[j]
next