samples/13_path_finding_algorithms/02_detailed_breadth_first_search/app/main.rb
# Cells have a number rendered in them based on when they were explored
# This is based off of their index in the cell_numbers array
# Cells are added to this array the same time they are added to the frontier array
Cells have a number rendered in them based on when they were explored
This is based off of their index in the cell_numbers array
Cells are added to this array the same time they are added to the frontier array
Cells have a number rendered in them based on when they were explored This is based off of their index in the cell_numbers array Cells are added to this array the same time they are added to the frontier array
def render_cell_numbers
    state.cell_numbers.each_with_index do |cell, index|
      label_x = (cell.x * grid.cell_size) + grid.cell_size / 2 - 5
      label_y = (cell.y * grid.cell_size) + (grid.cell_size / 2) + 5
      outputs.labels << [label_x, label_y, (index + 1).to_s]
    end
  end
def render_cell_numbers state . cell_numbers . each_with_index do | cell , index | label_x = ( cell . x * grid . cell_size ) + grid . cell_size / 2 - 5 label_y = ( cell . y * grid . cell_size ) + ( grid . cell_size / 2 ) + 5 outputs . labels << [ label_x , label_y , ( index + 1 ) . to_s ] end end
Cells have a number rendered in them based on when they were explored
This is based off of their index in the cell_numbers array
Cells are added to this array the same time they are added to the frontier array
Cells have a number rendered in them based on when they were explored This is based off of their index in the cell_numbers array Cells are added to this array the same time they are added to the frontier array
# Math that approx centers the number in the cell