bin/server.js
function getSolutionByNum(solutionSet, num) {
  if(solutionSet.computed.length >= num && num >= 1) {
    if(solutionSet.computed.length == num) { // If we select the last computed solution, we checked if we can compute more solutions.
      if(solutionSet.remaining !== false) {
        console.log("Checking for ambiguity #" + (num + 1));
        var lt = sns.lazyList.tail(solutionSet.remaining);
        var newSolution = getOneSolution(solutionSet.path, solutionSet.serverFileContent, lt);
        if(newSolution === false) {
          console.log("No more ambiguity");
          solutionSet.remaining = false;
        } else {
          console.log("Ambiguity #" + (num + 1) + " found");
          solutionSet.remaining = lt;
          solutionSet.computed.push(newSolution);
        }
      }
    }
    return solutionSet.computed[num - 1];
  } else {
    console.log(`Requested invalid solution number ${num}. Returning the first`)
    return solutionSet.computed[0];
  }
}
function getSolutionByNum(solutionSet, num) {
  if(solutionSet.computed.length >= num && num >= 1) {
    if(solutionSet.computed.length == num) { // If we select the last computed solution, we checked if we can compute more solutions.
      if(solutionSet.remaining !== false) {
        console.log("Checking for ambiguity #" + (num + 1));
        var lt = sns.lazyList.tail(solutionSet.remaining);
        var newSolution = getOneSolution(solutionSet.path, solutionSet.serverFileContent, lt);
        if(newSolution === false) {
          console.log("No more ambiguity");
          solutionSet.remaining = false;
        } else {
          console.log("Ambiguity #" + (num + 1) + " found");
          solutionSet.remaining = lt;
          solutionSet.computed.push(newSolution);
        }
      }
    }
    return solutionSet.computed[num - 1];
  } else {
    console.log(`Requested invalid solution number ${num}. Returning the first`)
    return solutionSet.computed[0];
  }
}
function getSolutionByNum ( solutionSet , num ) { if ( solutionSet . computed . length >= num && num >= 1 ) { if ( solutionSet . computed . length == num ) { // If we select the last computed solution, we checked if we can compute more solutions.
 if ( solutionSet . remaining !== false ) { console . log ( "Checking for ambiguity #" + ( num + 1 ) ) ; var lt = sns . lazyList . tail ( solutionSet . remaining ) ; var newSolution = getOneSolution ( solutionSet . path , solutionSet . serverFileContent , lt ) ; if ( newSolution === false ) { console . log ( "No more ambiguity" ) ; solutionSet . remaining = false ; } else { console . log ( "Ambiguity #" + ( num + 1 ) + " found" ) ; solutionSet . remaining = lt ; solutionSet . computed . push ( newSolution ) ; } } } return solutionSet . computed [ num - 1 ] ; } else { console . log ( ` ${ num } ` ) return solutionSet . computed [ 0 ] ; } }
Retrieves the given solution by 1-based index from the set of solutions If the solution is the last computed, computes remaining solutions
Retrieves the given solution by 1 - based index from the set of solutions If the solution is the last computed computes remaining solutions