samples/13_path_finding_algorithms/03_breadcrumbs/app/main.rb
# Calculates the path from the target to the star after the search is over
# Relies on the came_from hash
# Fills the search.path hash, which is later rendered on screen
Calculates the path from the target to the star after the search is over
Relies on the came_from hash
Fills the search.path hash, which is later rendered on screen
Calculates the path from the target to the star after the search is over Relies on the came_from hash Fills the search . path hash which is later rendered on screen
def calc_path
    endpoint = grid.target
    while endpoint
      search.path[endpoint] = true
      endpoint = search.came_from[endpoint]
    end
  end
def calc_path endpoint = grid . target while endpoint search . path [ endpoint ] = true endpoint = search . came_from [ endpoint ] end end
Calculates the path from the target to the star after the search is over
Relies on the came_from hash
Fills the search.path hash, which is later rendered on screen
Calculates the path from the target to the star after the search is over Relies on the came_from hash Fills the search . path hash which is later rendered on screen