enlever les grosses usines à gaz

This commit is contained in:
joniboy74prog
2023-12-08 04:33:38 +01:00
parent ea269654e3
commit c32dbed07c
+2 -16
View File
@@ -156,22 +156,8 @@ function getImg2(categorie, indice){
// function for random index of a function // function for random index of a function
function getNextIndex(indicesArray) { function getIndex(){
if (indicesArray.length === 0) {
// Si tous les indices ont été utilisés, réinitialiser le tableau d'indices
return null; // ou une autre valeur pour indiquer que tous les indices ont été utilisés
}
return indicesArray.shift();
} }
const votreTableau = await getQuestionByCategorie2('transport');
const shuffledIndices = createShuffledIndicesArray(votreTableau);
// À chaque appel, récupérez le prochain indice
const premierIndice = getNextIndex(shuffledIndices);
const deuxiemeIndice = getNextIndex(shuffledIndices);
console.log(premierIndice); // Indice aléatoire
console.log(deuxiemeIndice); // Indice différent