Netlogo : change patch color of one patch if orthogonal neighbors have the same color -


I'm new to netlogo and I need some help.

I am trying to make a continuous growth of a color patch (green on a black background). However, I sometimes have a black patch that is completely surrounded by green patches. I would like to change the color of those black patches in green.

I tried:

  inquire [if with neighbors 4 [pcolor = 55] [pcolor 55 set]]  

But it gives me an error, such as

  question patch [if any? Neighbors 4 [pcolor = 55] [set pcolor 55]]  

Here is the code which sometimes works except the black patch surrounded by green patches:

Comments