I've trying to build a object that's like this:
Code: Select all
[ ]
[ ][ ][ ]
I've set up a spreadsheet to define the number of rows & columns (in the example above it's 2 rows, 3 colums).
In the spreadsheet, the user can define if a block is present or not by entering a 1 in the block matrix (so it looks like this:
Code: Select all
Pin pattern below Column 1 Column 2 Column 3 Column 4 Column 5 Column 6
Row 1 1
Row 2 1 1 1
Row 3
Row 4
I'm able to compute the used number of blocks (using sum() function) so I can compute a position shift if I pre-iterate the block count but there is no "if" function in the spreadsheet (nor "for") so looping is not really easy.
How can I create the initial shape ?