GrandLamoz,
<script>
function random(min,max,l,x)
{var arr = [],m = [],n = 0, x = x || 1;
if (max - min < l-1) return;
for (var i=0; i<=(max-min); i++)m[i] = (i + min)*x;
for (var i=0; i<l; i++) {n = Math.floor(Math.random()*(m.length)); arr[i]=m.splice(n,1)[0];};
return arr
}
document.write(JSON.stringify(random(1,20,5,5)))
</script>
|