All pastes #191763 Raw Edit

Stuff

public text v1 · immutable
·published 2006-10-05 10:41 UTC
rendered paste body
int recurseSearch(currentCity, lookingForCity, currentDepth, maxDepth) {
   if (currentDepth>maxDepth) {
      return FALSE;
   }
   
   int i = 0;
   while ((currentCity <= BOUNDARY)&&(currentDepth<=maxDepth)){
      if(isConnectedRail(game,currentCity,i)) {
         if (i == lookingForCity) {
            return TRUE;
         } else {
            if(recurseSearch(i, lookingForCity, currentDepth+1, maxDepth)){
               return TRUE;
            }
         }
      }
   }
   return FALSE;
}