def points
bend-visgraph@2.0.0.0 · visgraph.bend:491
import bend-visgraph@2.0.0.0/visgraph.bend as Visgraph
import Base
491def points(count: Nat, +i: U32, lr: Array<U32> & U32, rr: Array<U32> & U32, w: Walked, +index: Bool, +g: Visibility, +dir: Direction, +k: Weight, +lo: F32, +hi: F32) -> Out:
492 match count:
493 case 0n:
494 (lefts, l) = lr
495 (rights, r) = rr
496 Walked{yr, xr, es} = w
497 (ys, y) = yr
498 (xs, x) = xr
499 Out{Cols{ys, lefts, rights}, xs, es}
500 case 1n+c:
501 (lefts, +l) = lr
502 (rights, +r) = rr
503 Walked{yr, xr, es} = w
504 (ys, +y) = yr
505 (xs, +xv) = xr
506 +x = pick(index, U32.to_f32(i), xv)
507 +i2 = (i + 1 : U32)
508 points(c, i2, Array.get(U32, lefts, i2), Array.get(U32, rights, i2), left_sweep(g, index, U32.to_nat(l), dir, k, lo, hi, i, x, y, right_sweep(g, index, U32.to_nat(r), Array.get(F32, ys, i2), xs, k, lo, hi, i, x, y, es)), index, g, dir, k, lo, hi)