March 2019
Intermediate to advanced
336 pages
9h 9m
English
The PrintLinks method of MapLayout prints the places and the links:
// PrintLinks methodfunc (mapLayout *MapLayout) PrintLinks() { var root Place root = Place{"Algeria", 3, 28} fmt.Printf("Printing all links adjacent to %s\n", root.Name) var node Place for node = range mapLayout.Links[root] { fmt.Printf("Link: %s -> %s\n", root.Name, node.Name) } var m map[Place]struct{} fmt.Println("Printing all links.") for root, m = range mapLayout.Links { var vertex Place for vertex = range m { fmt.Printf("Link: %s -> %s\n", root.Name, vertex.Name) } }}
Read now
Unlock full access