to wysoluje liczby z zakresu 1-321.. a jak dodać do tego warunek, by losowało liczby jedynie podzielne przez 16?
Math.floor(Math.random()*321)
function random(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
var p; for(x=1,y=0; x<=320; x=x+16,y++) p[y] = x; alert( p[Math.floor(Math.random()*p.length)] );
function randomDivider(min, max, divider) { return (Math.floor(Math.random() * (Math.floor(max / divider) - Math.ceil(min / divider) + 1)) + Math.ceil(min / divider)) * divider; }