def depth_seek
import bendtorch-core@0.1.0.0/src/storage/main.bend as BendtorchCoreimport Base
21def depth_seek(fuel: Nat, +n: Nat, +depth: Nat, +capacity: Nat, done: Bool) -> Nat & Nat:
22 match fuel done:
23 case 0n _:
24 (depth, capacity)
25 case 1n+p True{}:
26 (depth, capacity)
27 case 1n+p False{}:
28 +next = Nat.add(capacity, capacity)
29 depth_seek(p, n, 1n+depth, next, Nat.is_le(n, next))