Sorting Algorithms/Circle Sort: Difference between revisions

m
(Added XPL0 example.)
m (→‎{{header|Wren}}: Minor tidy)
Line 2,733:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">var circleSort // recursive
circleSort = Fn.new { |a, lo, hi, swaps|
if (lo == hi) return swaps
Line 2,762:
}
 
var asarray = [ [6, 7, 8, 9, 2, 5, 3, 4, 1], [2, 14, 4, 6, 8, 1, 3, 5, 7, 11, 0, 13, 12, -1] ]
for (a in asarray) {
System.print("Before: %(a)")
while (circleSort.call(a, 0, a.count-1, 0) != 0) {}
9,482

edits