Feel free to edit the title; I had a hard time figuring out how to explain it in a single line.
Here goes. I'm trying to generate these grids automatically, and randomly.
I have a grid of 25 tiles (indicated by #)
#####
#####
#####
#####
Let's say that I have 2 monsters I want to place in this grid, each monster occupies 3 or 4 tiles, with different patterns (these are not random, but is defined somewhere).
Monster 1 indicated by the letter A Monster 2 indicated by the letter B
An example of this:
#AA##
#BA##
#BBB#
#####
Or it could be (this is whre the randomness comes in):
AA###
#A###
#B###
#BBB#
How would I go about calculating where, for example, monster B fits in the grid after A has been placde? Monster B has a pattern of:
B
BBB
And A has a pattern of:
AA
A
A possible pattern could also be (for a different monster than A and B):
C
C
C
Is this even possible to automate? Hope that makes sense, otherwise I can try drawing it instead.
Thanks