Knuth shuffle: Difference between revisions
m
→{{header|Inform 6}}: Match style to the DM4
m (→ES5) |
m (→{{header|Inform 6}}: Match style to the DM4) |
||
Line 2,502:
=={{header|Inform 6}}==
<syntaxhighlight lang="inform 6">[ shuffle a n i j tmp;
for (i = n - 1: i > 0: i--) {
j = random(i + 1) - 1;▼
▲ j = random(i + 1) - 1;
tmp = a->j;
a->j = a->i;
a->i = tmp;
}
];</syntaxhighlight>
|