Nested For Loop Question

Hi All,

I’m building a City Generator currently using nested for loops to create a Grid.

for (int x = 0; x < gridX; x++)
 {
 for (int z = 0; z < gridZ; z++)
 {
 Build City
 }
 }

I would like to group areas of the grid to make Regions like below in the example below where gridX = 5 and gridZ = 5 and Regions = 5.
188634-grid2.jpg

Is this possible? and how?

Thanks,

i think if you are using this you always get one things.
you must use Random.range to get random number