func Render
Render renders the demo for gnoweb.
Example
1Render("") / Render("/") -> the full demo
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package dijkstrademo is a small gnoweb demo of the shortest-path search provided by the [p/moul/x/daily/dijkstra](/p/...
gno.land/r/moul/x/daily/dijkstrademo/v0A gnoweb page for the shortest-path search in p/moul/x/daily/dijkstra: the cheapest route to every node, the order the search settles them in, and the tie-break that makes both reproducible.
1import "gno.land/r/moul/x/daily/dijkstrademo/v0"
2
3dijkstrademo.Render("") // → the whole page, from fixed inputs
The library's own tests prove it computes the right distances. They cannot show what the algorithm is doing, and the thing most worth seeing is the settle order: always the closest node still outstanding, never the next one along an arc. That is the entire difference from a breadth-first walk, and it is why a cheap long way round beats an expensive short one.
Every figure on the page is computed, never written down. The seven-arc network and the three-spoke fanout are declared at the top of the realm and nothing else feeds them, so ExampleRender pins the output byte for byte: change the search and the diff lands in the test rather than in the prose.
Three behaviours worth knowing before you read it:
east has a direct arc costing 4 and the answer is 3 through north; port is first offered at 9 and ends at 8, two settlements later. A demo whose greedy first guess happened to be right would teach nothing.quarry is in the graph with no arcs. Unreachable is an answer the page shows, not an error it hides, because a realm reading Dist has to handle it either way.No search logic of its own, no chain state, no caller input: stateless and deterministic, which is what makes it pinnable.
Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.
Dependency graph:

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.
Package dijkstrademo is a small gnoweb demo of the shortest-path search provided by the p/moul/x/daily/dijkstra(/p/moul/x/daily/dijkstra/v0) library: the cheapest route to every node, the order the search settles them in, and the tie-break that makes both reproducible.
It contains no search logic of its own. Stateless, so Render is deterministic: every figure below comes from the fixed graphs declared at the top of this file, never from chain state, which is what lets an example test pin the page.