def loop

ezx@1.11.0.0 · src/tool/run.bend:283

import ezx@1.11.0.0/src/tool/run.bend as Run
import Base
import ezx@1.11.0.0/src/tool/world.bend as TW
import ezx@1.11.0.0/src/tool/plan.bend as TP

283# the loop, under fuel. Every round adds an answer, since the planner never
284# asks what the World answers already, and it asks at most five rounds, so
285# the fuel is only a guard.
286def loop(fuel: Nat, +world: TW.World) -> IO(Unit):
287  match fuel:
288    case 0n:
289      IO.die(Unit, 1, "ez: ez tool kept asking questions")
290    case 1n+f:
291      loop.step(TP.step(world), world, w => loop(f, w))

Uses (7)

Used by (1)