function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function getRandomArray(len, min, max, mid) {
const res = [];
let rand;
for (let i = 0; i < len; i++) {
if (Math.random() < 0.5) {
rand = getRandomInt(min, (max - min) / 2 + min - mid);
}
else {
rand = getRandomInt((max - min) / 2 + min + mid, max);
}
res.push(rand);
}
return res;
}
getRandomArray(10, 100, 1750, 30);
https://repl.it/repls/LiveWorthlessJavabytecode