Jump to content

Sorting algorithms/Permutation sort: Difference between revisions

Added Arturo implementation
m (→‎{{header|REXX}}: changed whitespace and comments.)
(Added Arturo implementation)
Line 496:
.include "../affichage.inc"
</lang>
 
=={{header|Arturo}}==
 
<lang rebol>sorted?: function [arr][
previous: first arr
 
loop slice arr 1 (size arr)-1 'item [
if not? item > previous -> return false
previous: item
]
return true
]
 
permutationSort: function [items][
loop permutate items 'perm [
if sorted? perm -> return perm
]
]
 
print permutationSort [3 1 2 8 5 7 9 4 6]</lang>
 
{{out}}
 
<pre>1 2 3 4 5 6 7 8 9</pre>
 
=={{header|AutoHotkey}}==
ahk forum: [http://www.autohotkey.com/forum/post-276680.html#276680 discussion]
1,532

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.