Language is C++
Hey everyone I am having trouble doing the following:
Test if (x,y) is already on the path. This can be done by comparing the kth element of p with the columns before it.
p[0][k] = x (x values, which are the columns.)
p[1][k] = y (y values, which are the rows.)
for ( int i = k; i<= k ; i--){
if (p[0][i] && p[1][i] == p[0][k] && p[1][k]){
k = k-1;
return;
}
else{
// do something;
}
Not sure if I have the right idea here...Any help would be much appreciated. Thank you.
Hey everyone I am having trouble doing the following:
Test if (x,y) is already on the path. This can be done by comparing the kth element of p with the columns before it.
p[0][k] = x (x values, which are the columns.)
p[1][k] = y (y values, which are the rows.)
for ( int i = k; i<= k ; i--){
if (p[0][i] && p[1][i] == p[0][k] && p[1][k]){
k = k-1;
return;
}
else{
// do something;
}
Not sure if I have the right idea here...Any help would be much appreciated. Thank you.
Comment