2019 Day 17 Complete
This commit is contained in:
@@ -123,6 +123,7 @@ func BFS(start, goal *BFSNode) (bool, []*BFSNode) {
|
||||
var queue, explored []*BFSNode
|
||||
queue = append(queue, start)
|
||||
if start == goal {
|
||||
fmt.Println(queue)
|
||||
return true, queue
|
||||
}
|
||||
explored = append(explored, start)
|
||||
@@ -131,6 +132,7 @@ func BFS(start, goal *BFSNode) (bool, []*BFSNode) {
|
||||
if len(queue) > 1 {
|
||||
current, queue = queue[0], queue[1:]
|
||||
if current == goal {
|
||||
fmt.Println(explored)
|
||||
return true, explored
|
||||
} else {
|
||||
children := current.getChildren()
|
||||
|
Reference in New Issue
Block a user