001 grid two declaration forms

✓ Passing This code compiles and runs correctly.

Code

input.k

Actual

writes landed
thread 349451728 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`
???:?:?: 0x10268e8df in _output_emitted.main_module.__KoruGridT_buckets.__koru_at__anon_19422 (???)
???:?:?: 0x10268e343 in _output_emitted.main_module.__grid_write_L51_e0b6_event.__koru_handler_impl (???)
???:?:?: 0x10268dadf in _output_emitted.main_module.flow5 (???)
???:?:?: 0x10268d777 in _output_emitted.main (???)
???:?:?: 0x10268d66b in _main (???)
???:?:?: 0x1816a3dff in ??? (???)
???:?:?: 0x0 in ??? (???)

Expected patterns

Each line is a regex that must match the program output.

writes landed
std/grid: index out of range for grid

Flows

flow ~new click a branch to expand · @labels scroll to their anchor
new (buckets, size: 8, source: count: 0[i64])
flow ~new click a branch to expand · @labels scroll to their anchor
new (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 EXPECT_TRAP · exit # Zig panic handler aborts: 128 + SIGABRT(6) = 134. 134