Lua · TIC-80

Not Cool

A set of pathfinding algorithms for the TIC-80 fantasy console. They're not COOOOOOOOOOOOOOOOOL.

Demo

Watch the search sweep across the grid in real time.

Pathfinding demo animation

Algorithms

Eight classic search strategies, each shipped as a standalone cartridge script.

A* Search

a-star.lua

Heuristic-guided search that balances path cost and estimated distance to the goal.

Breadth First Search

bfs.lua

Explores level by level, guaranteeing the shortest path on an unweighted grid.

Bidirectional BFS

bi-dir-bfs.lua

Runs two frontiers from start and goal, meeting in the middle to cut the search space.

Depth First Search

dfs.lua

Dives deep along each branch before backtracking. Fast, but not shortest-path.

Dijkstra's Algorithm

dijkstra.lua

Expands by lowest accumulated cost, finding shortest paths on weighted graphs.

Greedy Best First Search

gbfs.lua

Always steps toward the goal by heuristic alone. Quick, but not always optimal.

Iterative Deepening A*

ida-star.lua

Combines A* heuristics with depth-limited iterations for low memory use.

Iterative Deepening DFS

iddfs.lua

Repeated depth-limited DFS that gets BFS-like completeness with DFS-like space.

Usage

Getting an algorithm running inside TIC-80.

  1. Run TIC-80.
  2. Choose an algorithm and place its xxx.lua in your current working directory.
  3. Add dofile('xxx.lua') to the first line of the code editor.
  4. Import sprites from sprites.gif.
  5. Import the map from world.map, or draw your own.
  6. Run the cartridge.

Key Map

Controls once the cartridge is running.

ActionKey
Control "C"Z
Control "L"X
Up
Down
Left
Right