code: def find_water_flow(self, world, water_path):
          
  
          # iterate through each cell
          for x in range(world.width - 1):
              for y in range(world.height - 1):
                  # search around cell for a direction
                  path = self.find_quick_path([x, y], world)
                  if path:
                      tx, ty = path
                      flow_dir = [tx - x, ty - y]
                      key = 0
                      for direction in DIR_NEIGHBORS_CENTER:
                          if direction == flow_dir:
                              water_path[y, x] = key
                          key += 1
docs: Find the flow direction for each cell in heightmap