1
I would like you to have a button with the function of PAUSE
, and eliminate duplicate numbers.
A down counter that when I press the PAUSE
it displays the result number with the TOTAL of generated lines .
function append(el) {
//eu coloco os 16 primeiro digitos aqui, e ele gera mais 4 aleatorio
var txt = "1212" + "9057" + "9240" + "8105";
var x = Math.floor((Math.random() * 9000) + 1000);
document.getElementById(el).innerHTML += txt + x + "<br>";
//tempo de gerar numeros 1s
setTimeout(function() {
append("timeout");
}, 1000);
//AQUI EU QUERO UM FILTRA PARA NAO DUPLICAR
// E UM BOTAO DE PAUSE E UM TXT COM TOTAL DE LINHAS GERADAS
}
append("timeout");
<p>GERADOR DE NUMEROS SEM REPETIÇAO E COM BOTAO DE PAUSE</p>
<hr>
<button name="pause" id="pause">PAUSE</button>
<div id="timeout"></div>
<div id="interval"></div>
Got it, you want to pause the number generator as soon as you click the pause button, correct?
– Marconi
YES , pause it when I want, and at the end of the pause or the result it shows me the total number generated ('Total results generated --> 5040 ') [EXAMPLE] at the end of each pause it presents me the total, and if it has how to add not to duplicate tbm would be great, but my focus is more on having a PAUSE button and a total count of results to be displayed at the end
– Mandrake Venom
I will add an answer, and I will edit to adjust your need.
– Marconi