001 grid two declaration forms

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

writes landed
thread 338416386 panic: std/grid: index out of range for grid 'buckets' (size 8) - a grid is addressed by position, and wrapping is the program's to write as `% 8`
???:?:?: 0x1003628a7 in _output_emitted.main_module.__KoruGridT_buckets.__koru_at__anon_19425 (???)
???:?:?: 0x10036231b in _output_emitted.main_module.__grid_write_L51_e0b6_event.__koru_handler_impl (???)
???:?:?: 0x100361ad3 in _output_emitted.main_module.flow5 (???)
???:?:?: 0x100361777 in _output_emitted.main (???)
???:?:?: 0x10036166b in _main (???)
???:?:?: 0x18eec7dff in ??? (???)
???:?:?: 0x0 in ??? (???)

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: buckets, size: 8, source: count: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (expr: lights, dimensions: 4x5, source: on: 0[i64])
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: buckets[2].count: 41)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: buckets[2].count: buckets[2].count + 1)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: lights[3, 2].on: 7)
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: lights[3, 2].on: lights[3, 2].on * 6)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "writes landed")
flow ~stored click a branch to expand · @labels scroll to their anchor
stored (source: buckets[buckets[2].count].count: 0)
flow ~print.ln click a branch to expand · @labels scroll to their anchor
print.ln (expr: "unreachable")

Test Configuration

MUST_RUN