mercredi 25 décembre 2019

How can i make my random number generator stop producing the same numbers?(Java)

I have created a random number generator and i want to avoid repeating the same values. Here is my code:

function function1(){
var randomNumber = Math.floor(Math.random() * 30) + 1;
var imgName = "pic (" + randomNumber + ").jpg";
document.getElementById("imgid2").src="Pictures" + "/" + imgName;



Aucun commentaire:

Enregistrer un commentaire