boolean function(object, currentLocation, Termination){
if (currentLocation satisfies Terminaiton){
return true;
}
for (go through all the nextLocations){
if (unsatisfy condition) return false;
if ( function(object[], ChangedObject, nextCurrentLocation, Termination)) return true;
}
return false;
}