I want to make a clone of an Amiga 500 game, Pick A Brick, a 2D game where the goal is to clear a table of bricks by matching them up, following certain rules. I am getting nowhere when it comes to the algorithm for generating the layout of the bricks. I have added the rules of the game (as I remember them) below.
- The player wins the game by clearing all tiles before the time runs out.
- Tiles are cleared by clicking on a pair of them and if the following is true:
- The tiles must be of the same type (there is only one pair of each type).
- There is a clear path between them (more on path in the points below).
- The path from a tile must always start towards an (clear) edge of the screen.
- The path between the tiles must be u-shaped.
(edit) NOTE: In the video the path is not always the u-shaped. I do not recall if the path shown is just a shortcut or not, but regardless, in my version I do not want to allow removing tiles "from inside out".
I have done some manual testing/prototyping using both outside in and inside out approaches, with variations on both. So far, nothing I have come up with has really come close. I kind of dislike asking a question like this since it is so specific, probably not of general interest and may take up more than a little time for anyone interested in helping out. That being said, some people enjoy coming up with algorithms and "solving stuff", and the community may learn something from the answer, so, a post it is.
(edit) Clarification. The algorithm must provide a solvable solution.