docs: function pairMatcherOld(alg, n, options) {
          var ps, matches, bye;
          var i, lenI, j, lenJ, jj;
          var id1, id2;
          var roundsLimit, cycle, cycleI, skipBye;
  
          if ('number' === typeof n && n > 1) {
              ps = J.seq(0, (n-1));
          }
          else if (J.isArray(n) && n.length > 1) {
              ps = n.slice();
              n = ps.length;
          }
          else {
              throw new TypeError('pairMatcher.' + alg + ': n must be ' +
                                  'number > 1 or array of length > 1.');
          }
          options = options || {};
  
          bye = 'undefined' !== typeof options.bye ? options.bye : -1;
          skipBye = options.skipBye || false;
  
          // Make sure we have even numbers.
          if ((n % 2) === 1) {
              ps.push(bye);
              n += 1;
          }
  
          // Limit rounds.
          if ('number' === typeof options.rounds) {
              if (options.rounds <= 0) {
                  throw new Error('pairMatcher.' + alg + ': options.rounds ' +
                                  'must be a positive number or undefined. ' +
                                  'Found: ' + options.rounds);
              }
              if (options.rounds > (n-1)) {
                  throw new Error('pairMatcher.' + alg + ': ' +
                                  'options.rounds cannot be greater than ' +
                                  (n-1) + '. Found: ' + options.rounds);
              }
              // Here roundsLimit does not depend on n (must be smaller).
              roundsLimit = options.rounds;
          }
          else {
              roundsLimit = n-1;
          }
  
          if ('undefined' !== typeof options.cycle) {
              cycle = options.cycle;
              if (cycle !== 'mirror_invert' && cycle !== 'mirror' &&
                  cycle !== 'repeat_invert' && cycle !== 'repeat') {
  
                  throw new Error('pairMatcher.' + alg + ': options.cycle ' +
                                  'must be equal to "mirror"/"mirror_invert", ' +
                                  '"repeat"/"repeat_invert" or undefined . ' +
                                  'Found: ' + options.cycle);
              }
  
              matches = new Array(roundsLimit*2);
          }
          else {
              matches = new Array(roundsLimit);
          }
  
          i = -1, lenI = roundsLimit;
          for ( ; ++i < lenI ; ) {
              // Shuffle list of ids for random.
              if (alg === 'random') ps = J.shuffle(ps);
              // Create a new array for round i.
              lenJ = n / 2;
              matches[i] = skipBye ? new Array(lenJ-1) : new Array(lenJ);
              // Check if new need to cycle.
              if (cycle) {
                  if (cycle === 'mirror' || cycle === 'mirror_invert') {
                      cycleI = (roundsLimit*2) -i -1;
                  }
                  else {
                      cycleI = i+roundsLimit;
                  }
                  matches[cycleI] = skipBye ?
                      new Array(lenJ-1) : new Array(lenJ);
              }
              // Counter jj is updated only if not skipBye,
              // otherwise we create holes in the matches array.
              jj = j = -1;
              for ( ; ++j < lenJ ; ) {
                  id1 = ps[j];
                  id2 = ps[n - 1 - j];
                  if (!skipBye || (id1 !== bye && id2 !== bye)) {
                      jj++;
                      // Insert match.
                      matches[i][jj] = [ id1, id2 ];
                      // Insert cycle match (if any).
                      if (cycle === 'repeat') {
                          matches[cycleI][jj] = [ id1, id2 ];
                      }
                      else if (cycle === 'repeat_invert') {
                          matches[cycleI][jj] = [ id2, id1 ];
                      }
                      else if (cycle === 'mirror') {
                          matches[cycleI][jj] = [ id1, id2 ];
                      }
                      else if (cycle === 'mirror_invert') {
                          matches[cycleI][jj] = [ id2, id1 ];
                      }
                  }
              }
              // Permutate for next round.
              ps.splice(1, 0, ps.pop());
          }
          return matches;
      }