Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in A* #6

Open
fabianlischka opened this issue Jun 13, 2020 · 0 comments
Open

Bug in A* #6

fabianlischka opened this issue Jun 13, 2020 · 0 comments

Comments

@fabianlischka
Copy link

visited = set(start) must be replaced by visited = set(), visited.add(start) or so, as it doesn't add the tuple to the set, but iterates over the content of said tuple and adds that.

In [1]: point1 = (1,2) 
In [2]: point2 = (3,4)
In [3]: visited = set(point1)
In [4]: visited.add(point2)
In [5]: point2 in visited
Out[5]: True
In [6]: point1 in visited
Out[6]: False
In [7]: visited
Out[7]: {(3, 4), 1, 2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant