.
This commit is contained in:
2
grid.js
2
grid.js
@@ -176,7 +176,7 @@ class Grid {
|
||||
]
|
||||
}
|
||||
|
||||
toGraph(neighbors = "getAdjNeighbors", cxn = (node, cxnNode) => node.addCxn(cxnNode, cxnNode.val)) {
|
||||
graphify(neighbors = "getAdjNeighbors", cxn = (node, cxnNode) => node.addCxn(cxnNode, cxnNode.val)) {
|
||||
this.mapMut((e) => new Node(e))
|
||||
this.forEach((e, pt) => this[neighbors](pt).forEach((pt) => cxn(e, this.get(pt))))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user