hehe yeah, just read what I wrote and lost myself as well
Let's try one more time
White = value 0
Red = value 1
Blue = value "X"
1. There is an array of some width and some height randomly filled with 0 and 1.
2. I want to set value "X" at X=6 and Y=4. If that XY 6,4 is 0 then I can set it to "X" just fine.
3. But array can change after some time .
4. And now value at XY 6,4 is 1 and I can't set it to "X" anymore.
5. I need to find the nearest available cell to XY 6,4 with value = 0 (any direction or distance).
6. So I can safely set it to "X".
If that grid would be made of sprites then I could simply use "Pick nearest" action to pick nearest sprite with variable = 0... But it's a bit more complicated with arrays.