Hello. I am not very strong in matane, so I am interested in the question of how to find empty cells of arbitrary size (+ in an arbitrary table) + depending on the position of the cells?
If someone does not understand, here are examples.
false - busy cells, true - empty.
Example 1. You need to find a free cell 2 on 1 (height, width)
local matrix = { { true, false, false }; { true, false, true }; }; -- matrix[1][1]-->true -- matrix[2][1]-->true Example 2. You need to find a free cell 2 by 2 (height, width)
local matrix = { { false, true, true }; { true, true, true }; }; -- matrix[1][2]-->true -- matrix[1][3]-->true -- matrix[2][2]-->true -- matrix[2][3]-->true Example 3. You need to find a free cell 2 by 2 (height, width)
local matrix = { { true, true, false }; { false, true, true }; }; -- false Thank!