The “pattern-filling with tiles” puzzle
问题 I've encountered an interesting problem while programming a random level generator for a tile-based game. I've implemented a brute-force solver for it but it is exponentially slow and definitely unfit for my use case. I'm not necessarily looking for a perfect solution, I'll be satisfied with a “good enough” solution that performs well. Problem Statement: Say you have all or a subset of the following tiles available (this is the combination of all possible 4-bit patterns mapped to the right,