Moving Squares

I used my Dijkstra’s algorithm implementation to add squares that make it clear where programs can move:

The translucent overlays are on squares that the Hack could get to within three moves. It takes obstacles into account, and updates as things move and the grid changes.

Dijkstra’s Algorithm

I implemented Dijkstra’s algorithm in order to determine how many moves it will take a program to get to a particular grid square. It will be useful both for enemy AI and displaying which squares are within the movement range of a program. It takes obstacles into account.

I made it display the numbers on the grid for illustrative purposes, and to make sure it was working. Each number is how many moves it would take the green slingshot program to get to that square.