abracadabraPDF › Forums › PDF – Général › Nombre aléatoire sous condition › Répondre à : Nombre aléatoire sous condition
28 octobre 2023 à 08:07
#73395

Maître des clés
bonjour,
Personnellement je placerais tes lignes dans une boucle while :
while (Nb1*Nb6 == Nb3*Nb4) {
var Nb1=Math.round(Math.random()*7)+2;
var Nb2=Math.round(Math.random()*9)+1;
var Nb3=Math.round(Math.random()*9)+1;
var Nb4=Math.round(Math.random()*8)+1;
var Nb5=Math.round(Math.random()*8)+1;
var Nb6=Math.round(Math.random()*9)+1;
}
@+