Sorting algorithms/Strand sort: Difference between revisions

Content added Content deleted
(Racket version)
(→‎{{header|Perl 6}}: minor shortening: factoring take)
Line 810: Line 810:
gather {
gather {
while @x and @y {
while @x and @y {
given @x[0] cmp @y[0] {
take do given @x[0] cmp @y[0] {
when Increase { take @x.shift }
when Increase { @x.shift }
when Decrease { take @y.shift }
when Decrease { @y.shift }
when Same { take @x.shift, @y.shift }
when Same { @x.shift, @y.shift }
}
}
}
}