bfs #1
3
wozek.py
3
wozek.py
@ -280,7 +280,8 @@ def bfs(isstate,final):
|
|||||||
explored.append(node)
|
explored.append(node)
|
||||||
successors=succ(node)
|
successors=succ(node)
|
||||||
for successor in successors:
|
for successor in successors:
|
||||||
fringe.append(successor)
|
if (successor not in fringe and successor not in explored):
|
||||||
|
fringe.append(successor)
|
||||||
|
|
||||||
# Main game loop
|
# Main game loop
|
||||||
def game_loop():
|
def game_loop():
|
||||||
|
Loading…
Reference in New Issue
Block a user