samples/13_path_finding_algorithms/04_early_exit/app/main.rb
# This method is called every frame/tick
# Every tick, the current state of the search is rendered on the screen,
# User input is processed, and
# The next step in the search is calculated
This method is called every frame/tick
Every tick, the current state of the search is rendered on the screen,
User input is processed, and
The next step in the search is calculated
This method is called every frame / tick Every tick the current state of the search is rendered on the screen User input is processed and The next step in the search is calculated
def tick
    defaults
    if state.visited.empty?
      state.max_steps.times { step }
      calc_path
    end
    render
    input
  end
def tick defaults if state . visited . empty? state . max_steps . times { step } calc_path end render input end
This method is called every frame/tick
Every tick, the current state of the search is rendered on the screen,
User input is processed, and
The next step in the search is calculated
This method is called every frame / tick Every tick the current state of the search is rendered on the screen User input is processed and The next step in the search is calculated
# If the grid has not been searched # Complete the search # And calculate the path