samples/13_path_finding_algorithms/05_dijkstra/app/main.rb
# Moves the star to the cell closest to the mouse in the first grid
# Only resets the search if the star changes position
# Called whenever the user is editing the star (puts mouse down on star)
Moves the star to the cell closest to the mouse in the first grid
Only resets the search if the star changes position
Called whenever the user is editing the star (puts mouse down on star)
Moves the star to the cell closest to the mouse in the first grid Only resets the search if the star changes position Called whenever the user is editing the star ( puts mouse down on star )
def input_star
    old_star = state.star.clone
    unless cell_closest_to_mouse == state.target
      state.star = cell_closest_to_mouse
    end
    unless old_star == state.star
      reset_search
    end
  end
def input_star old_star = state . star . clone unless cell_closest_to_mouse == state . target state . star = cell_closest_to_mouse end unless old_star == state . star reset_search end end
Moves the star to the cell closest to the mouse in the first grid
Only resets the search if the star changes position
Called whenever the user is editing the star (puts mouse down on star)
Moves the star to the cell closest to the mouse in the first grid Only resets the search if the star changes position Called whenever the user is editing the star ( puts mouse down on star )