ytil,
для новых браузеров
<script>
function makeRand(num) {
var usedNumbers = [];
function f() {
if(usedNumbers.length == num) usedNumbers = [];
var i = Math.floor(Math.random() * num) + 1;
return usedNumbers.includes(i) ? f() : (usedNumbers.push(i),i)
}
return f;
}
var x = makeRand(100);
document.write(x()+"<br>");
document.write(x()+"<br>");
document.write(x()+"<br>");
</script>