Sattolo cycle: Difference between revisions
Content deleted Content added
No edit summary |
No edit summary |
||
Line 874:
[5, 4, 3, 0, 2, 1]
</pre>
=={{header|EasyLang}}==▼
<syntaxhighlight lang="text">▼
func sattolo_cycle . a[] .▼
for i = len a[] downto 2▼
r = random (i - 1)▼
swap a[r] a[i]▼
.▼
.▼
arr[] = [ 1 2 3 ]▼
call sattolo_cycle arr[]▼
print arr[]▼
</syntaxhighlight>▼
=={{header|Delphi}}==
Line 946 ⟶ 933:
</pre>
▲=={{header|EasyLang}}==
▲<syntaxhighlight lang="text">
▲func sattolo_cycle . a[] .
▲ for i = len a[] downto 2
▲ r = random (i - 1)
▲ swap a[r] a[i]
▲ .
▲.
▲arr[] = [ 1 2 3 ]
▲call sattolo_cycle arr[]
▲print arr[]
▲</syntaxhighlight>
|