006 sweep writes the cell it visits

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

total 165

Expected output

✓ Zig✓ JavaScript
total 165

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: cells, size: 8, source: n: 0[i64], avg: 0.0[f32], sum: 0.0[f32])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: acc, source: total: 0[i64])
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: cells[2].n: 4)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: cells[2].sum: 10.0)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: cells[5].n: 2)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: cells[5].sum: 7.0)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (expr: cells)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (expr: cells)
flow ~sweep click a branch to expand · @labels scroll to their anchor
sweep (expr: cells)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "total {{ acc.total:d }}")

Test Configuration

MUST_RUN