In this task, we create logic to make multilayered pattern compositions from player's selection and then compare it with the quest pattern's composition.
We need a way to represent the pattern overlapping and non-overlapping relationships.
We will use the data structure of this section to remember the overlapping relationship. Most patterns will overlap others, so we would need to think the other way round. So, we store those patterns that do not overlap together.
The pattern is a two-dimensional (2D) array. The first dimension contains every pattern. Each pattern is a list of the other patterns that do not overlay with it.
For example, ...