samples/13_path_finding_algorithms/01_breadth_first_search/app/main.rb
def input_remove_wall
    # The mouse needs to be inside the grid, because we only want to remove walls
    # the cursor is directly over
    # Recalculations should only occur when a wall is actually deleted
    if mouse_inside_grid?
      if state.walls.has_key?(cell_closest_to_mouse)
        state.walls.delete(cell_closest_to_mouse)
        recalculate
      end
    end
  end
# Removes walls that are under the cursor
Removes walls that are under the cursor
Removes walls that are under the cursor
def input_remove_wall
    if mouse_inside_grid?
      if state.walls.has_key?(cell_closest_to_mouse)
        state.walls.delete(cell_closest_to_mouse)
        recalculate
      end
    end
  end
def input_remove_wall if mouse_inside_grid? if state . walls . has_key? ( cell_closest_to_mouse ) state . walls . delete ( cell_closest_to_mouse ) recalculate end end end
Removes walls that are under the cursor
Removes walls that are under the cursor
# The mouse needs to be inside the grid, because we only want to remove walls # the cursor is directly over # Recalculations should only occur when a wall is actually deleted