I was wondering if creating a Grid could create a random path
Better explaination:
We have a grid from A to E (Vertical) and from 1 to 5 (Horizontal)
Every square will be called A1,C2, D4 and so on according to the grid position
Now, A3 (TopCenter) and E3 (BottomCenter) will be End(A3) and Start (E3)
From E3 i want to get the Position of the square, example (0, 0, -2)
The center will be C3 with the position of (0,0,0)
According to the grid now the Start point will have a Math.Random value from 1 to 100.
If the number will be from 1 to 33 the square will clonate and move to a square on his left, on position (-1,0,-2) aka E2
At this point we have E3 and E2 as square used for the path, now E2 will repeat the Math.Random from 1 to 100 and will have 50% of chance for going up and 50% for left because the right is already picked and the bottom has nothing
I will use table to declare Picked and UnPicked squares
Also the grid will divide in more 3 Squares
The first square will be the center, named as 0 or C3-0
The second square will have all the 8 squares that are close to the center and will be marked as 1 or B3-1,D4-1 and so on.
Same for the external square with the -2 for every square
Now, the path make script will also have another number that will increase on every square created, and when reached the max (ex. 3 squares) will force the next square to be inside the internal square (the -2) and the same will happen for this square, if the C Row has been reached, this system will work at reverse, making it go to the bigger square, this until it will teach the End aka A3-1
NOTE: The more is a square near to the exit, more will be his % of being picked as path.
I would like to see if you guys think this is possible and any questions about