Skip to main content

reachable

Function reachable 

Source
pub fn reachable(
    width: u16,
    height: u16,
    start: Pos,
    budget: u32,
    cost: impl Fn(Pos) -> Option<u32>,
) -> Reach
Expand description

Where a walker on start can go with budget to spend on a width × height grid, where entering a tile costs cost(tile) (None: it can’t be entered). A start outside the grid reaches nothing.