【Help】How to make a proliferation algorithm

I want to make a proliferation algorithm.

If it decides the starting point,
Growing toward good figures around.

Does this require loop processing or recursion processing?
Do I need to use Python?

The following image is what I am thinking.

Regards,
zer0

Hello,

I would recommend writing code. Doesn’t need to be recursive, can be solved by a simple loop.

pseudo code (main logic, you will need to implement functions and classes):

while (True): 
   unvisitedCells = getAdjacentUnvisitedCells(currentCell)
   if (unvisitedCells.count< 1):
       return
   currentCell = pickCellWithHeighestValue(unvisitedCells)
   currentCell.visited = True
   walkedCells.append(cell)