Grid search demo¶
A public maze fixture: pure BFS snapshots plus a small playback composition.
Run python -m bruhanimate.demos.grid_demo. Space pauses, n/right steps, +/- changes speed, and q quits. The final path remains visible until quit.
- class bruhanimate.demos.grid_demo.SearchState(current: tuple[int, int], visited: frozenset[tuple[int, int]], frontier: frozenset[tuple[int, int]], path: tuple[tuple[int, int], ...] = (), complete: bool = False)[source]¶
- current: tuple[int, int]¶
- visited: frozenset[tuple[int, int]]¶
- frontier: frozenset[tuple[int, int]]¶
- path: tuple[tuple[int, int], ...] = ()¶
- complete: bool = False¶
- __init__(current: tuple[int, int], visited: frozenset[tuple[int, int]], frontier: frozenset[tuple[int, int]], path: tuple[tuple[int, int], ...] = (), complete: bool = False) None¶
- bruhanimate.demos.grid_demo.solve(board=('#############', '#S..#.......#', '#.#.#.#####.#', '#.#...#...#.#', '#.#####.#.#.#', '#.......#..E#', '#############'))[source]¶
Yield immutable BFS snapshots without terminal access or retained history.
This small example copies sets into snapshots; large searches should sample or aggregate progress rather than produce a snapshot of every branch.