- Home /
Duplicate Question. Forum cross post: https://forum.unity.com/threads/how-to-create-a-matrix-with-the-same-values-connected.1263629/
How to create a matrix with the same values connected in C#
I need to create a matrix with random integers, but the same values must be connected.For example, if "1" is created as a cell, at least one of the cells of it's right, left,up or down must be "1" or it must be the only "1" valued cell. Just like this:
1 1 1 2 2 2
1 1 3 3 2 2
1 4 4 5 5 2
1 1 1 5 6 7
1 8 8 5 5 7
Not like this, because the bottom-right 1 is not connected to any of 1s:
1 1 1 2 2 2
1 1 3 3 2 2
1 4 4 5 5 2
1 1 1 5 6 7
1 8 8 5 5 1
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Translating gui.matrix to java problem 1 Answer
how to use matrice with unity 3D 1 Answer