Search color patterm on the grid

unhandled

(chiharu) #1

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


Combinatorial optimization
(Laurent Delrieu) #2

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)


(chiharu) #3

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


(Laurent Delrieu) #4

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.