samples/13_path_finding_algorithms/03_breadcrumbs/app/main.rb
def input_target
    old_target = grid.target.clone
    grid.target = cell_closest_to_mouse
    unless old_target == grid.target
      reset_search
    end
  end
# Moves the target to the grid closest to the mouse in the first grid
# Only reset_searchs the search if the target changes position
# Called whenever the user is editing the target (puts mouse down on target)
Moves the target to the grid closest to the mouse in the first grid
Only reset_searchs the search if the target changes position
Called whenever the user is editing the target (puts mouse down on target)
Moves the target to the grid closest to the mouse in the first grid Only reset_searchs the search if the target changes position Called whenever the user is editing the target ( puts mouse down on target )
def input_target
    old_target = grid.target.clone
    grid.target = cell_closest_to_mouse
    unless old_target == grid.target
      reset_search
    end
  end
def input_target old_target = grid . target . clone grid . target = cell_closest_to_mouse unless old_target == grid . target reset_search end end
Moves the target to the grid closest to the mouse in the first grid
Only reset_searchs the search if the target changes position
Called whenever the user is editing the target (puts mouse down on target)
Moves the target to the grid closest to the mouse in the first grid Only reset_searchs the search if the target changes position Called whenever the user is editing the target ( puts mouse down on target )