samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
# Moves the star to the grid closest to the mouse
# Only recalculates the search if the star changes position
# Called whenever the user is dragging the star 
Moves the star to the grid closest to the mouse
Only recalculates the search if the star changes position
Called whenever the user is dragging the star
Moves the star to the grid closest to the mouse Only recalculates the search if the star changes position Called whenever the user is dragging the star
def input_star
    old_star = state.star.clone 
    state.star = cell_closest_to_mouse 
    unless old_star == state.star 
      recalculate 
    end
  end
def input_star old_star = state . star . clone state . star = cell_closest_to_mouse unless old_star == state . star recalculate end end
Moves the star to the grid closest to the mouse
Only recalculates the search if the star changes position
Called whenever the user is dragging the star
Moves the star to the grid closest to the mouse Only recalculates the search if the star changes position Called whenever the user is dragging the star