From c4104a5cd33275c0ae79530e182c4538c9d3f2f3 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 21 Aug 2015 17:04:01 +0200 Subject: 8-connected graph instead of 4-connected --- pathfinding.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pathfinding.py b/pathfinding.py index ce3ab8e..2b6a7aa 100644 --- a/pathfinding.py +++ b/pathfinding.py @@ -22,7 +22,7 @@ class Node: def siblings(point,grid): x,y = point.point_in_grid - links = [grid[d[0]][d[1]] for d in [(x-1, y),(x,y - 1),(x,y + 1),(x+1,y)]] + links = [grid[d[0]][d[1]] for d in [(x-1, y),(x-1,y-1),(x,y - 1),(x+1,y-1),(x+1,y),(x+1,y+1),(x,y + 1),(x-1,y+1)]] return [link for link in links if link.value != None] def distance(point,point2): -- cgit v1.2.3