var div = document.createElement('div');
document.body.appendChild(div);
var len = 10;
var redNum = 5;
var redScope = 18;
var blueNum = 2;
var blueScope = 12;
var redList = [];
for (var i = 0; i < len; i += 1) {
redList.push([]);
while (redList[i].length < redNum) {
var num = parseInt(Math.random() * (redScope - 1)) + 1;
if (!redList[i].includes(num)) {
redList[i].push(num);
}
}
redList[i].sort(function(a, b) { return a - b; });
}
var blueList = [];
for (var i = 0; i < len; i += 1) {
blueList.push([]);
while (blueList[i].length < blueNum) {
var num = parseInt(Math.random() * (blueScope - 1)) + 1;
if (!blueList[i].includes(num)) {
String(num).length === 1
blueList[i].push(num);
}
}
blueList[i].sort(function(a, b) { return a - b; });
}
for (var i = 0; i < len; i += 1) {
div.innerHTML += redList[i].join(',') +
' ' + blueList[i].join(',') + '<br/>'
}