I haven't looked at any of the examples, but I think the "pick closest" would work for a fill if you worked it like a stack.
You would iterate all the sides "pick closest" x+1,y+1,x-1,y-1, compare the distance, and put picks on the variable stack.
If there were no match's pop the top of the stack.
goto 1