Grids and Graphs

First-class 2D grids with built-in pathfinding.

The `grid` keyword parses a multi-line string into a 2D grid, mapping characters to values. Use `_` as a wildcard.

Loading WASM...

Access grid cells with `g[row, col]` or get a full row with `g[row]`. Use `width` and `height` to get dimensions.

Loading WASM...

`flood_fill` finds all connected cells from a starting point. Provide a `walkable` predicate to control which cells can be traversed.

Loading WASM...

`bfs` performs breadth-first search given a start, goal, and neighbors function. It returns the shortest path.

Loading WASM...

You are not logged in.