RECUPERE O SISTEMA PARA NÃO CALCULAR ACERTOS COM N
This commit is contained in:
parent
78395f19fd
commit
81b268e90d
@ -356,6 +356,21 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Filtra sequências longas (Permite no máx 2 números consecutivos)
|
||||
function hasForbiddenSequence(numbers) {
|
||||
const sorted = [...numbers].sort((a, b) => a - b);
|
||||
let currentSeq = 1;
|
||||
for (let i = 1; i < sorted.length; i++) {
|
||||
if (sorted[i] === sorted[i - 1] + 1) {
|
||||
currentSeq++;
|
||||
if (currentSeq > 2) return true; // Bloqueia 3 ou mais
|
||||
} else {
|
||||
currentSeq = 1;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function generateChunk() {
|
||||
if (!generatorRunning) return;
|
||||
|
||||
@ -366,15 +381,24 @@
|
||||
let sequence = [];
|
||||
let safetyCounter = 0;
|
||||
|
||||
while (sequence.length < nToDraw && safetyCounter < 500) {
|
||||
// Tenta gerar uma sequência válida
|
||||
while (sequence.length < nToDraw && safetyCounter < 1000) {
|
||||
// Incremento dinâmico para evitar padrões lineares puros
|
||||
let step = Math.floor(Math.random() * 3) + 1;
|
||||
let val = ((currentStartNum - 1) % maxNum) + 1;
|
||||
currentStartNum++;
|
||||
currentStartNum += step;
|
||||
|
||||
safetyCounter++;
|
||||
if (annulledFunnel.has(val)) continue;
|
||||
sequence.push(val);
|
||||
if (!sequence.includes(val)) sequence.push(val);
|
||||
}
|
||||
|
||||
if (sequence.length === nToDraw) {
|
||||
// Validação de Sequência Real (Máx 2 consecutivos)
|
||||
if (hasForbiddenSequence(sequence)) {
|
||||
continue; // Descarta e tenta a próxima no próximo loop
|
||||
}
|
||||
|
||||
const hits = sequence.filter(n => lotteryData.elite_greens.includes(n)).length;
|
||||
if (hits >= 4) {
|
||||
let type = hits === 4 ? "QUADRA" : (hits === 5 ? "QUINA" : "SENA");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user