# Four elements repetition in a texture [closed]

I have to create a texture using 4 different elements (call them A,B,C,D or whatever you want) on a 6x7 grid. The goal is to obtain a pattern with the least repetitions of the same element in horizontal, vertical and diagonal directions, especially, if possible, should be avoided to repeat the same element in adjacent blocks. I think there should be different solution to this, just answer with what you came up with.

## closed as too broad by March Ho, Novarg, xnor, Len, AlexisMar 7 '15 at 10:18

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• I'm not clear on what you're counting as a repetition. – xnor Mar 6 '15 at 21:45
• I know this question sounds simple but is varies alot based on priority. Is A and A being diagonally adjacent worse than horizontally adjacent? Is A and A being diagonally adjacent worse than it having three As separate but in the same row? – kaine Mar 6 '15 at 22:22

Starting from the nucleus

$$a b a\\ b c b\\ a b a\\$$

add "layers" of two characters alternating onto the nucleus. For example, the next iteration will be

$$c d c d c\\ d a b a d\\ c b c b c\\ d a b a d\\ c d c d c\\$$

This array can be extended infinitely, and all elements of this infinite array will have neighbours in all 8 directions that are different from itself, except at the corners.

$$c d c d c d\\ a b a b a b\\ c d c d c d\\ a b a b a b\\ c d c d c d\\ a b a b a b\\ c d c d c d\\$$

Simply take a 6x7 subset of this infinite array at any position where no corner exists to produce an answer.

Here is one:

$$a b c d a b\\ b c d a b c\\ c d a b c d\\ d a b c d a\\ a b c d a b\\ b c d a b c\\ c d a b a d\\$$

In the row you must have 2 repetitions and in the column 3.

• If you look in diagonal, there is the same letter in each oblique line (going from lower left to upper right) – Lorenzo Mar 6 '15 at 21:14
• You are right! I missed diagonally. – Moti Mar 7 '15 at 2:14