20Mhz
07/18/2020, 1:24 AM// copy all the grids on (n1, A1) and (n2, A2) to tmp arrays, and keep the
// grids order A1->n1->A2 copy (n1, A1)
cnt_n1A1 = copyGrids(
treenodes, A1, n1, treeedges, edge_n1A1, gridsX_n1A1, gridsY_n1A1);
// copy (n1, A2)
cnt_n1A2 = copyGrids(
treenodes, n1, A2, treeedges, edge_n1A2, gridsX_n1A2, gridsY_n1A2);
// update route for (n1, A1) and (n1, A2)
// find the index of E1 in (n1, A1)
E1_pos = -1;
for (i = 0; i < cnt_n1A1; i++) {
// reach the E1
if (gridsX_n1A1[i] == E1x && gridsY_n1A1[i] == E1y) {
E1_pos = i;
break;
}
}
if (E1_pos == -1) {
exit(1); // PROBLEM HERE
}