samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
# Whenever the user edits the grid,
# The search has to be recalculated upto the current step
Whenever the user edits the grid,
The search has to be recalculated upto the current step
Whenever the user edits the grid The search has to be recalculated upto the current step
def recalculate
    state.frontier = [] 
    state.visited = {} 
    state.cell_numbers = []
    state.anim_steps.times { calc } 
  end
def recalculate state . frontier = [ ] state . visited = { } state . cell_numbers = [ ] state . anim_steps . times { calc } end
Whenever the user edits the grid,
The search has to be recalculated upto the current step
Whenever the user edits the grid The search has to be recalculated upto the current step
# Resets the search # Moves the animation forward one step at a time