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