ADS-framework/graphTester.go
2016-02-22 14:16:11 +01:00

24 lines
522 B
Go

package main
import (
"fmt"
"lib/graph"
)
func main() {
n := &graph.Node{Value: "1"}
n2 := new(graph.Node)
n2.Value = "2"
n3 := new(graph.Node)
n3.Value = "3"
n.Connect(n2)
n.Connect(n3)
n2.Connect(n3)
//n.DisconnectAll()
fmt.Println(n.IsConnectedTo(n3))
fmt.Println("n -> n2: ", n2.IsConnectedTo(n), " n <- n2: ", n.IsConnectedTo(n2))
fmt.Println("n -> n3: ", n.IsConnectedTo(n3), " n <- n3: ", n3.IsConnectedTo(n))
fmt.Println("n2 -> n3: ", n2.IsConnectedTo(n3), " n2 <- n3: ", n3.IsConnectedTo(n2))
}