Jump to content

Knuth shuffle: Difference between revisions

(Added XPL0 example.)
Line 1,087:
<pre>20 5 6 9 15 23 22 8 4 24 7 11 16 21 2 17
14 10 19 13 12 18 1 3 25</pre>
 
==={{header|OxygenBasic}}===
<lang>
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
</lang>
 
==={{header|Sinclair ZX81 BASIC}}===
54

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.