def walk
bolt@1.27.0.0 · src/lint/plan.bend:101
import bolt@1.27.0.0/src/lint/plan.bend as Plan
import Base
import bolt@1.27.0.0/src/lint/world.bend as W
101
102
103
104
105def walk(
106 fuel: Nat,
107 +world: W.World,
108 queue: List<&2, String>,
109 acc: List<&2, String>,
110 seen: List<&2, String>
111) -> Walk:
112 match fuel:
113 case 0n:
114 Walk{acc, seen}
115 case 1n+f:
116 match queue:
117 case Nil{}:
118 Walk{acc, seen}
119 case Con{+dir, rest}:
120 +es = W.listing(world, dir)
121 walk(f, world, List.append(&2, String, rest, walk.dirs(es, dir)),
122 List.append(&2, String, walk.bends(es, dir), acc), dir <> seen)