exercism/go/pov/cmd/main.go

21 lines
308 B
Go
Raw Permalink Normal View History

2017-08-15 22:06:46 +00:00
package main
2017-08-17 18:12:16 +00:00
import (
"fmt"
pov ".."
)
2017-08-15 22:06:46 +00:00
func main() {
g := pov.New()
g.AddNode("sibling")
g.AddNode("x")
2017-08-17 18:12:16 +00:00
g.AddArc("parent", "sibling")
g.AddArc("parent", "x")
2017-08-17 18:12:16 +00:00
fmt.Println("== Change Root to child-3 ==")
g.Print("parent")
n := g.ChangeRoot("parent", "x")
fmt.Println(n.ArcList())
g.Print("x")
2017-08-15 22:06:46 +00:00
}