How do I connect my vertices in my mesh

136536-t.pngSo I am creating a low poly game with procedural low poly terrain generation. I know that unity smooths out triangles with shared vertices so I took that in to consideration. The way I did it was check if the vertice is not an edge vertice and if it wasn’t instead of adding one add 6 to that position since if a vertice is not an edge it will always be used 6 times from the triangles around it so instead of sharing I just created separate vertices. I got it to work properly but the problem is now I am having trouble connecting the triangles. The way the vertices are created are in columns. Heres an image… and in this image the vertices are labeled like the order they are in the list. My problem is coming up with an algorithm or what ever to connect theses triangles properly. I can’t seem to figure it out. Thanks for the help!

@Bunny83 any ideas on how I could sort this out?