import traceback, turtle, time
#Change this value to adjust the time between turtle actions in seconds
draw_delay = 0.05
#Set this to False to turn off turtle entirely.
enable_turtle = True
#Set this to True to execute DFS tests before BFS tests
dfs_first = False
#Takes as input a Square object node in a graph of Square nodes.
# This will always be the Square node representing (0,0), the start position
#Performs BFS/DFS until the goal Square is found (the Square with color = "blue").
#Returns a list containing each Square node in the path from the start
# (0,0) to the goal node, inclusive, in order from start to goal.
def bfs_find_path(start_node):
start_node.set_color("gray")
start_node.prev = None
#TODO: Finish the BFS and return the path from start_node to the goal
return [start_node, start_node.adj[0]] #Placeholder return to avoid errors
def dfs_find_path(start_node):
start_node.set_color("gray")
start_node.prev = None
#TODO: Finish the BFS and return the path from start_node to the goal
return [start_node, start_node.adj[0]] #Placeholder return to avoid errors