actors :: FannkuchRedux :: count_flips
fun count_flips: Int do
var flips = 1
var first = p[0]
if p[first] != 0 then
p.copy_to(0, pp.length, pp, 0)
while pp[first] != 0 do
flips += 1
var lo = 1
var hi = first - 1
while lo < hi do
var t = pp[lo]
pp[lo] = pp[hi]
pp[hi] = t
lo += 1
hi -= 1
end
var t = pp[first]
pp[first] = first
first = t
end
end
return flips
end
lib/actors/examples/fannkuchredux/fannkuchredux.nit:72,2--94,4