Concider I have an incomplete 2d array, with some of it's cells blocked, like this:
I want to fill that array with given tetris like shapes (perfect solution not guaranteed), those are the rules:
- Path always connected, no "holes"
- Pieces are pre-known and are enough to cover exactly 100% of path (if fitting)
- Pieces can be rotated and flipped, makes it 8 different ways to place each piece
My question is, how can I brute-force it and ensure I actually checked all the variations?
My plan was to start from left top corner and seek for the next empty cell in a loop.
But then I don't know what to do when i get stuck. Maybe store placed pieces in a stack and try different ways but the fact I can both rotate pieces and change their places was too much for me. Working with java in case that's matter. thanks!