Search color patterm on the grid

Hello,everyone

I want to search color pattern on the grid like this.

I can not paint cell under the following conditions
・two consecutive horizonal rows
・3 or more consective vertical rows

when I can choose cell to paint, I choose randamly.

Any suggestions or hints will be greatful!
thanks in advance

Hello the idea could be
Make an array of empty cell n * m
It is possible to add a shape like =>1 cell or 2 cells in column,
When you add this shape on free place suppress the possibility to add shape on adjacent cells … redo that until it is OK
I made something like this here

It was not too difficult to modify the script, without a lot of test.



pattern of color.gh (15.6 KB)

thank you so much!!
I try it! :smile:

Hope it helps. You have done a clear description of what you want.
If you need it could be possible to change the number ratio between shapes.