Procedural generation with constraints based on Wave Function Collapse algorithm.
For an input string generates string of similar structure, respecting all constrains in an input string.
INPUT: "AAXBBX", N=2, cellnum=8:
OUTPUT: "XAAAXBXBXBBBXAAA"
INPUT: "DOG", N=3, cellnum=5
OUTPUT: "OGDOGDOGDOGDOGD"
For an input:
here is an output:
- Not all inputs are viable
- Input should be small and simple
- Big input will add a lot of constraints and it may take ages to complete
- Often it does have a "deadlock" meaning it is unsolvable, script will end without an output