helena wrote:Since you can't have a XY array of irregular width.
You said it. So at no point will you have a row smaller than another row. The best you could do is:
1. Choose your random column (cell)
2. Re-order that row so that cell's value is at the end of the row
3. Repeat for each row
4. Finally, set the array width to it's current width -1
Now you have an array with width 1 less than before
Repeat the above steps until you have no more columns (cells).
Hopefully you will do something meaningful in between the above steps!
So this is not possible, because it goes against your original assertion. (Although conceptually, it could be thought of this way).
Then a loop for every horizontal row, you pick one cell at random, and then delete it. Making the width of THAT row one cell smaller.
Is this close to what you're asking?
edit: added a capx, hope it helps (it's 10x10 but it's dynamically set, just change it).
The array is represented on-screen. Tap on the layout to process each column and observe.
You do not have the required permissions to view the files attached to this post.