I am looking for an algorithm that will help me build rule-based 2D templates. The idea is that I could write a script using the given site parameters, and it will return a random two-dimensional sequence to a certain length.
My plan is to use this to create rule-based image templates. Things like image fractals or sprites for game levels could use this.
For example, let's say that you can use A, B, C, and D to create a template. The rule is that C and A can never be next to each other and that D always follows C. Next, say, I want a 4x4 template. The result may be the following, which complies with all the rules.
ABCD BBBB CDBB CDCD
Are there existing libraries that can perform the calculations as follows? Are there any math formulas that I can read?
source share