function generateSequence(pattern, parity, check) {
  if (pattern.length !== 6) {
    return null;
  }

  check = parseInt(check);
  parity = parseInt(parity);

  var p = PAIRITYMAP[check][parity],
    seq = START;

  for (var i = 0; i < 6; i++) {
    seq = seq.concat( BARMAP[ p[i] ][ parseInt(pattern[i]) ] );
  }

  return seq.concat(END);
}
function generateSequence(pattern, parity, check) {
  if (pattern.length !== 6) {
    return null;
  }

  check = parseInt(check);
  parity = parseInt(parity);

  var p = PAIRITYMAP[check][parity],
    seq = START;

  for (var i = 0; i < 6; i++) {
    seq = seq.concat( BARMAP[ p[i] ][ parseInt(pattern[i]) ] );
  }

  return seq.concat(END);
}
function generateSequence ( pattern , parity , check ) { if ( pattern . length !== 6 ) { return null ; } check = parseInt ( check ) ; parity = parseInt ( parity ) ; var p = PAIRITYMAP [ check ] [ parity ] , seq = START ; for ( var i = 0 ; i < 6 ; i ++ ) { seq = seq . concat ( BARMAP [ p [ i ] ] [ parseInt ( pattern [ i ] ) ] ) ; } return seq . concat ( END ) ; }
/*
generate sequence
@param String pattern
@param Number parity
@param Number check
/ * generate sequence