RosettaCodeData/Task/Knuth-shuffle/PL-I/knuth-shuffle-1.pli
2014-01-17 05:34:36 +00:00

6 lines
226 B
Text

declare T(0:10) fixed binary initial (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
declare (i, j, temp) fixed binary;
do i = lbound(T,1) to hbound(T,1);
j = min(random() * 12, 11);
temp = T(j); T(j) = T(i); T(i) = temp;
end;