I have a function that takes a board like this:
B[0] := [1, 0, 0, 1, 1, 0, 1];//0 = normal spot
B[1] := [1, 0, 0, 0, 0, 0, 1];//1 = Blocked Spot
B[2] := [0, 0, 0, 1, 0, 0, 0];//2 = Start
B[3] := [0, 1, 0, 1, 0, 1, 0];//3 = End
B[4] := [1, 0, 1, 0, 0, 0, 1];
B[5] := [0, 0, 0, 0, 1, 0, 0];
B[6] := [2, 0, 0, 0, 1, 1, 3];
And then outputs a path as a TPointArray like this:
[(0, 6), (0, 5), (1, 5), (2, 5), (3, 5), (3, 4), (4, 4), (5, 4), (5, 5), (6, 5), (6, 6)]//I made it reverse the co-ordinates so they are standard x and y, this means the fist spot is actually B[6][0]
If this is what you want let me know :)
Compiled successfully in 31 ms.
47
1 0 0 1 1 0 1
1 0 0 0 0 0 1
0 0 0 1 0 0 0
0 1 0 1 0 1 0
1 0 1 0 0 0 1
0 0 0 0 1 0 0
2 0 0 0 1 1 3
[(0, 6), (0, 5), (1, 5), (2, 5), (3, 5), (3, 4), (4, 4), (5, 4), (5, 5), (6, 5), (6, 6)]
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 8 0 0
0 4 0 6 7 8 0
2 3 4 5 0 9 10
1 2 3 4 0 0 11
Successfully executed.
47 is time running, at that point it has already generated the path
Also I put some randomness in it, so sometimes it comes out as:
[(0, 6), (1, 6), (2, 6), (2, 5), (3, 5), (3, 4), (4, 4), (5, 4), (5, 5), (6, 5), (6, 6)]
[(0, 6), (1, 6), (2, 6), (3, 6), (3, 5), (3, 4), (4, 4), (5, 4), (5, 5), (6, 5), (6, 6)]
Or others…