def walk_right

bendtorch-core@0.1.0.0 · src/shape/core.bend:453

import bendtorch-core@0.1.0.0/src/shape/core.bend as Core
import Base

453def walk_right(rows: List<&2, Row>, +index: Nat) -> Nat:
454  match rows:
455    case Nil{}:
456      0n
457    case Row{+stride, left, right} <> rest:
458      Nat.add(Nat.mul(right, Nat.div(index, stride)), walk_right(rest, Nat.mod(index, stride)))

Uses (7)

Used by (20)