actors :: FannkuchRedux :: run_task
fun run_task(task: Int) do
var idx_min = task * chunk_sz
var idx_max = fact[n].min(idx_min + chunk_sz)
first_permutation(idx_min)
var maxflips = 1
var chk_sum = 0
for i in [idx_min..idx_max[ do
if p[0] != 0 then
var flips = count_flips
maxflips = maxflips.max(flips)
chk_sum += if i % 2 == 0 then flips else -flips
end
if i + 1 != idx_max then next_permutation
end
max_flips[task] = maxflips
chk_sums[task] = chk_sum
end
lib/actors/examples/fannkuchredux/fannkuchredux.nit:96,2--116,4