Search⌘ K
AI Features

Exercise: Coloring Cells by Shortest Distance

Explore how to enhance maze visualization by coloring cells based on their shortest distance from a given set of cells using Dijkstra's algorithm. Understand how to modify the Cell class to accept multiple starting points and apply this knowledge to identify key areas within mazes, supporting puzzle design and game development.

We'll cover the following...

Problem statement

If a distances object represents some list of cells (perhaps a solution path, perhaps not), we'd like to be able to query a cell for the distance (for each cell in the grid) from any of the cells in the first distances object.

That is to say:

## given a 10x10 grid, we first ask for
...