Viewing a saved revision (read-only)
2e8afd8bde0549b68f31d0f1414c104b
Eloquent JS: Chapter 7 (project)
This example demonstrates a simulated delivery robot navigating a network of roads connecting locations in a village. It shows three different robot strategies—random movement, a fixed mail route, and goal-oriented pathfinding—and measures their efficiency by running many simulated parcel-delivery tasks and comparing the average number of steps taken. The JavaScript code defines a graph from a static list of road connections, implements a `VillageState` class to track robot position and undelivered parcels, and uses a breadth-first search (`findRoute`) for the goal-oriented robot. The simulation runs entirely in the console, with no visual output.
AI-generated descriptionA bare minimum HTML page demonstrating use of CSS and JavaScript.
See also React Starter.