✓
Passing This code compiles and runs correctly.
Code
import std/io
import std/table
// Pin #6: prove a generated table is consumable at RUNTIME (the sieve's spine) —
// fold the wheel with the capture pattern over `for ! each`. The runtime sum must
// equal the comptime sum from 310_094: 30030*5760/2 = 86,486,400.
from(wheel) { x over 0..30030 | keep gcd(x, 30030) == 1 }
capture { acc: 0[i64] }
! as a |> for(wheel)
! each r |> captured { acc: a.acc + r }
| captured result |> std/io:print.ln("{{ result.acc:d }}")
Actual
86486400
Expected output
86486400
Flows
flow ~from click a branch to expand · @labels scroll to their anchor
from (wheel, source: x over 0..30030 | keep gcd(x, 30030) == 1)
flow ~capture click a branch to expand · @labels scroll to their anchor
capture (source: acc: 0[i64])
Test Configuration
MUST_RUN