June 2018 Update

This commit is contained in:
Ingy döt Net 2018-06-22 20:57:24 +00:00
parent ba8067c3b7
commit 22f33d4004
5278 changed files with 84726 additions and 14379 deletions

View file

@ -0,0 +1,16 @@
arr := Array([2,3,1]):
len := numelems(arr):
#Translation of C, random swapping
shuffle_arr := proc(arr, len)
local i, r, temp:
for i from 1 to len do
temp := arr[i]:
r := rand(1..len)():
arr[i] := arr[r]:
arr[r] := temp:
end do:
end proc:
while(not ListTools:-Sorted(convert(arr, list))) do
shuffle_arr(arr, len):
end do:
arr;