you might consider a reccursive function... perhaps something like this..:
- check the 8 (or 4 if you don't want diagonal) slots around the current point. (starting f.ex. from the top left)
- if one of the slots is "open", run the same function again, jumping to that current "open" slot.. it will the check the slots around the new point/slot.
when it's done, all open slots should be filled...
I hope you understood what I meant..
- check the 8 (or 4 if you don't want diagonal) slots around the current point. (starting f.ex. from the top left)
- if one of the slots is "open", run the same function again, jumping to that current "open" slot.. it will the check the slots around the new point/slot.
when it's done, all open slots should be filled...
I hope you understood what I meant..