Example #1
0
 void solveNQueens__(int start, int end, vector<int>& qs, vector<vector<string>>& ret) {
     if (start < end) {
         for(int i = 0; i < end; i++) {
             qs[start] = i;
             if (isvalidpos(qs, start)) {
                 solveNQueens__(start+1, end, qs, ret);
             } else {
                 qs[start] = -1;
             }
         }
     } else {
         // push qs to ret
         addoutput(qs, ret);
     }
 }
Example #2
0
void MainWindow::loadPortNames() {
    int i;

    // Load Inputs first...
    if(midi->getNumInputPorts() > 0) {
        for(i=0; i < midi->getNumInputPorts(); i++) {
            addinput(midi->getInputPortName(i));
        }
    }

    // ... then outputs.
    if(midi->getNumOutputPorts() > 0) {
        for(i=0; i < midi->getNumOutputPorts(); i++) {
            addoutput(midi->getOutputPortName(i));
        }
    }
}
static int addsendresp(lsi_param_t *rec)
{   return addoutput(rec, "SEND2: If this appears, good.\n");  }
static int addrecvresp(lsi_param_t *rec)
{   return addoutput(rec, "RECV2: If this appears, good.\n");  }
static int addsendresp(lsi_param_t *rec)
{   return addoutput(rec, "SEND4: If this appears, something is wrong.\n");  }