subs_path - find_path()
14 A B C D E F G H I
In the subs_path tab, create a function named find_path()
int find_path(int indA, int indB) {
declare an integer named i
for (int j=0; j<paths.size(); j++) {
get the path at index j in paths
if (its iA field equals indA
and its iB field equals indB) {
set i to j
}
}
if i is -1 {
for (int j=0; j<paths.size(); j++) {
get the path at index j in paths
if (its iA field equals indB
and its iB field equals indA) {
set i to j
}
}
}
return i
} //find_path