A set of pathfinding algorithms for the TIC-80 fantasy console. They're not COOOOOOOOOOOOOOOOOL.
Watch the search sweep across the grid in real time.
Eight classic search strategies, each shipped as a standalone cartridge script.
a-star.lua
Heuristic-guided search that balances path cost and estimated distance to the goal.
bfs.lua
Explores level by level, guaranteeing the shortest path on an unweighted grid.
bi-dir-bfs.lua
Runs two frontiers from start and goal, meeting in the middle to cut the search space.
dfs.lua
Dives deep along each branch before backtracking. Fast, but not shortest-path.
dijkstra.lua
Expands by lowest accumulated cost, finding shortest paths on weighted graphs.
gbfs.lua
Always steps toward the goal by heuristic alone. Quick, but not always optimal.
ida-star.lua
Combines A* heuristics with depth-limited iterations for low memory use.
iddfs.lua
Repeated depth-limited DFS that gets BFS-like completeness with DFS-like space.
Getting an algorithm running inside TIC-80.
xxx.lua in your current working directory.dofile('xxx.lua') to the first line of the code editor.sprites.gif.world.map, or draw your own.Controls once the cartridge is running.
| Action | Key |
|---|---|
| Control "C" | Z |
| Control "L" | X |
| Up | ↑ |
| Down | ↓ |
| Left | ← |
| Right | → |