Sattolo cycle: Difference between revisions
Added 11l
Alextretyak (talk | contribs) (Added 11l) |
|||
Line 50:
{{Template:strings}}
<hr><br>
=={{header|11l}}==
{{trans|Python}}
<lang 11l>F sattolo_cycle(&items)
L(i) (items.len-1 .. 1).step(-1)
V j = random:(i)
swap(&items[j], &items[i])
L 3
V lst = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
sattolo_cycle(&lst)
print(lst)</lang>
{{out}}
<pre>
[7, 1, 4, 8, 9, 2, 5, 6, 10, 3]
[3, 8, 9, 2, 1, 5, 4, 10, 7, 6]
[2, 9, 7, 5, 1, 3, 8, 10, 6, 4]
</pre>
=={{header|AppleScript}}==
|