Gradient or attractor based numerical matrix - **Think Minesweeper**

Here’s a rather simple approach that uses a Python script to generate the numerical grid and allows you to turn certain cells - selected by their indices - into mines (or attractors) that then increment their neighbouring cell values by 1.

2022-01-07 10-17-41.2022-01-07 10_19_40

Mines have a default value of -1 and other cells are initialized as 0s.
Since, the placement of the mines can be randomized, it’s rather easy to do lots of iterations quickly.

2022-01-07 10_32_46.2022-01-07 10_35_08

As mentioned before, the grid only consists of integer numbers, which can be remapped and used as data to manipulate really any grid or geometry that is composed of the same number of elements as there are cells in the grid.

minesweeper.gh (23.3 KB)

3 Likes