samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
# The next frontier to be expanded is highlighted yellow
# Its adjacent non-wall neighbors have their border highlighted green
# This is to show the user how the search expands
The next frontier to be expanded is highlighted yellow
Its adjacent non-wall neighbors have their border highlighted green
This is to show the user how the search expands
The next frontier to be expanded is highlighted yellow Its adjacent non - wall neighbors have their border highlighted green This is to show the user how the search expands
def render_highlights
    return if state.frontier.empty?
    next_frontier = state.frontier[0]
    outputs.solids << [scale_up(next_frontier), highlighter_yellow]
    adjacent_neighbors(next_frontier).each do |neighbor|
      unless state.walls.has_key?(neighbor)
        outputs.solids << [scale_up(neighbor), highlighter_green, 70]
      end
    end
  end
def render_highlights return if state . frontier . empty? next_frontier = state . frontier [ 0 ] outputs . solids << [ scale_up ( next_frontier ) , highlighter_yellow ] adjacent_neighbors ( next_frontier ) . each do | neighbor | unless state . walls . has_key? ( neighbor ) outputs . solids << [ scale_up ( neighbor ) , highlighter_green , 70 ] end end end
The next frontier to be expanded is highlighted yellow
Its adjacent non-wall neighbors have their border highlighted green
This is to show the user how the search expands
The next frontier to be expanded is highlighted yellow Its adjacent non - wall neighbors have their border highlighted green This is to show the user how the search expands
# Highlight the next frontier to be expanded yellow # Neighbors have a semi-transparent green layer over them # Unless the neighbor is a wall