TutorialsDijkstra’s Algorithm

Appendix F — Glossary

One word for each idea, used the same way everywhere in the game and in this book.

Brush
The terrain chosen for painting (the Project Global brush).
Camp
The start cell (S). Maze Settings keeps its cell number in the column startCell, the algorithm’s own word.
Cell
One square of the map, numbered 0 to 119 in reading order. A Map Cell is the Object that draws one.
Cost
The price of entering a non-wall cell (Road 1, Forest 3, Mud 6).
Current cell
The cell the last Step settled (its Search Outline is white); none (-1) after a Reset.
Distance
The cheapest cost found so far from the camp to a cell.
Ending
How a trial ended: the Messages row End Trial shows (cheapestRoute, noRoute, invalidRoute, or the row of a broken input rule).
Find route
Run Step repeatedly on a named timer (searchTick) until done or paused. Find Route’s findRequested Modes are Start, Pause and Start Over.
Frontier
Reached, non-wall cells not yet settled.
Map
The 12 by 10 board of cells. The Object Map (no picture) lays it out when the Scene starts (Lay Out Map, and from Chapter 4 Lay Out Route Lines).
Map Place
The Data Structure in which a Map Cell or a Search Outline keeps its cell number (field cell).
Marker
The compass pawn that walks the finished route. The Project Global markerCell is the cell it stands on, or is sliding to once a move is committed.
Maze Rules
The Object that owns the trial and its live records in Maze Cells; buttons, cells and keys only ask it.
Mode
One of the ways an Event can run (Switch Mode, Turn On Mode, Turn Off Mode, Reset Modes).
Parent
The settled cell a cell’s best route came from.
Phase
Where the trial is: the Mode of Maze Rules’ stepRequested Event, one of Ready, Searching, Tracing, Replaying, Waiting For Marker, Finished.
Piece
One Object made for the map when the Scene starts: a Map Cell or a Search Outline (Lay Out Map), a Route Line or a Route Line Backing (Lay Out Route Lines).
Relax
Give a neighbor a smaller distance and a new parent, only when the new cost is strictly cheaper.
Reset
Clear the search and route, keeping the painted terrain.
Restore defaults
Put the supplied terrain back, then Reset.
Route
The chain of parents from the tower back to the camp, shown forward.
Route Cost
The sidebar text (the Cost readout) that shows the Route’s cost, the Tower’s distance, once the Tower is settled, and “--” before.
Route Line
The yellow line, over a dark Route Line Backing, that joins each two cells that follow each other on the Route.
Route Link
The Data Structure in which a Route Line or a Route Line Backing keeps the two cells it joins (fields cell and neighbor).
Search Outline
The ring over a cell that shows its place in the search: a thin cyan ring on the frontier, a thick blue ring once settled, thick white on the current cell, and from Chapter 4 thick yellow on the Route.
Selection
The ring around the selected cell, the cell the keyboard will paint (the Project Global selectedCell).
Settle
Choose the frontier cell with the smallest distance and mark it final.
Status
The sidebar line that says what the last Step did (the Project Global status); its words live only in Messages.
Step
One transition: settle one cell, trace one parent, or move the marker one cell.
Terrain
What a cell is: Road, Forest, Mud, or Wall (the rows of the Data Table Terrains).
Terrain Button
A sidebar button that shows one terrain’s name and cost and makes it the brush.
Terrain Preview
The terrain’s picture beside its button; activating it also makes that terrain the brush.
thisCell
Lay Out Route Lines’ Local Variable (Declare Variable, one cell’s run): the cell whose neighbors it is joining now; each new line takes cell = thisCell.
Tower
The goal cell (G). Maze Settings keeps its cell number in the column goalCell.
Trial
One run of Dijkstra’s algorithm on the terrain as it is: from Ready until it ends. Step Trial, Clear Trial, End Trial and Reset Trial are named for it.
Visited
The number of settled cells.
Wall
A cell that cannot be entered.