Sorting algorithms/Comb sort: Difference between revisions

Added Arturo implementation
m (→‎{{header|Phix}}: made runnable, added syntax colouring the hard way)
(Added Arturo implementation)
Line 575:
.include "../affichage.inc"
</lang>
=={{header|Arturo}}==
 
<lang rebol>combSort: function [items][
a: new items
gap: size a
swapped: true
 
while [or? gap > 1 swapped][
gap: (gap * 10) / 13
if or? gap=9 gap=10 -> gap: 11
if gap<1 -> gap: 1
swapped: false
i: 0
loop gap..dec size items 'j [
if a\[i] > a\[j] [
tmp: a\[i]
a\[i]: a\[j]
a\[j]: tmp
swapped: true
]
i: i + 1
]
]
return a
]
 
print combSort [3 1 2 8 5 7 9 4 6]</lang>
 
{{out}}
 
<pre>1 2 3 4 5 6 7 8 9</pre>
 
=={{header|AutoHotkey}}==
<lang autohotkey>List1 = 23,76,99,58,97,57,35,89,51,38,95,92,24,46,31,24,14,12,57,78
1,532

edits