ADS-framework/graphTester.go

28 lines
540 B
Go
Raw Normal View History

package main
2016-03-13 15:21:47 +00:00
import (
"fmt"
"lib/AbsDataStructures"
)
func main() {
2016-03-13 15:21:47 +00:00
n := &Nodes.Node{Value: "1"}
n2 := new(Nodes.Node)
n2.Value = "2"
2016-03-13 15:21:47 +00:00
n3 := new(Nodes.Node)
n3.Value = "3"
2016-02-25 12:49:33 +00:00
n.SetPointTo(n2)
n.SetPointTo(n3)
n2.SetPointTo(n3)
n2.SetPointTo(n)
n3.SetPointTo(n)
n.DisconnectAll()
fmt.Println("n -> n2: ", n.IsPointingTo(n2), " n <- n2: ", n2.IsPointingTo(n))
fmt.Println("n -> n3: ", n.IsPointingTo(n3), " n <- n3: ", n3.IsPointingTo(n))
fmt.Println("n2 -> n3: ", n2.IsPointingTo(n3), " n2 <- n3: ", n3.IsPointingTo(n2))
}