Sorting algorithms/Pancake sort: Difference between revisions

Content added Content deleted
(Added Wren)
(Updated to work with version 1.4 of Nim.)
Line 2,502: Line 2,502:
for i in countdown(length, 2):
for i in countdown(length, 2):
var maxNumPos = 0
var maxNumPos = 0
for a in 0 .. <i:
for a in 0 ..< i:
if list[a] > list[maxNumPos]:
if list[a] > list[maxNumPos]:
maxNumPos = a
maxNumPos = a