Chaque résultat donne
une lettre de l'alphabet.
Retrouve le mot complet !
Exemple : CHAT
🐾3 → C
8 → H
1 → A
20 → T
visibilityCarte des lettres
";
// On l'insère au début de la grille (avant tout le reste)
grid.insertBefore(premiereBox, grid.firstChild);
if (varSolutions == true) {
document.getElementById("phraseMyst").style.display = "none";
document.getElementById("phrase").style.display = "block";
document.querySelectorAll('.reponse').forEach(span => span.style.display = "inline");
document.querySelectorAll('.lettreRep').forEach(span => span.style.display = "inline");
document.querySelectorAll('.placeholderIntero').forEach(span => span.style.display = "none");
document.querySelectorAll('.mot').forEach(span => span.style.display = "inline");
}
if (varSolutions == false) {
document.querySelectorAll('.mot').forEach(span => span.style.display = "none");
document.getElementById("phraseMyst").style.display = "block";
document.getElementById("phrase").style.display = "none";
document.querySelectorAll('.reponse').forEach(span => span.style.display = "none");
document.querySelectorAll('.lettreRep').forEach(span => span.style.display = "none");
document.querySelectorAll('.placeholderIntero').forEach(span => span.style.display = "inLine");
document.querySelectorAll('.reponse').forEach(span => span.style.display = "none");
document.querySelectorAll('.lettreRep').forEach(span => span.style.display = "none");
}
if (modeEnfant == true) {
if (varOneDay == false) {
document.querySelectorAll('.motJour').forEach(el => el.style.display = 'none');
document.querySelectorAll('.motDuJour').forEach(el => el.style.display = 'none');
document.querySelectorAll('.numero').forEach(el => el.style.display = 'inLine');
let toutesLesBoxes = grid.querySelectorAll('.box');
toutesLesBoxes.forEach((box, index) => {
box.style.display = 'block';
});
}
else {
document.querySelectorAll('.motJour').forEach(el => el.style.display = 'inLine');
document.querySelectorAll('.motDuJour').forEach(el => el.style.display = 'inLine');
document.querySelectorAll('.numero').forEach(el => el.style.display = 'inLine');
let toutesLesBoxes = grid.querySelectorAll('.box');
toutesLesBoxes.forEach((box, index) => {
if (index === aujourdHui) {
// On affiche la boîte
box.style.display = 'block';
} else {
// Sinon, on la cache
box.style.display = 'none';
}
});
}
}
if (modeEnfant==false){
document.querySelectorAll('.motJour').forEach(el => el.style.display = 'none');
document.querySelectorAll('.motDuJour').forEach(el => el.style.display = 'none');
document.querySelectorAll('.numero').forEach(el => el.style.display = 'inLine');
let toutesLesBoxes = grid.querySelectorAll('.box');
toutesLesBoxes.forEach((box, index) => {
box.style.display = 'block';
});
}
choixCompteur=1; // nécessaire sinon à chaque clique sur le switch "semaine complete" ça continue de faire rouler ce compteur et le type d'equation evolue pour chaque ligne
monTexteEnCours="cxoc";
}
// Fonction qui est appelé depuis le petit bouton "Voir la suite" dans la premiere box "A toi de jouer !"
function btnGoMap(){
toggleDock();
// window.scrollTo({ top: document.getElementById("containerLettre").offsetTop, behavior: "smooth" });
}
// Comportement du switch : affiche une moitié différente des équations selon l’état du bouton : celle qui a été randomisée ou non
randomSwitch.addEventListener("change", function () {
if (randomSwitch.checked) {
parcourirPremiereMoitié = false;
afficherPhrase(monTexte, monNumero);
} else {
parcourirPremiereMoitié = true;
afficherPhrase(monTexte, monNumero);
}
});
/*
showJourSwitch.addEventListener("change", function () {
cacherJours();
});
*/
// Fonction qui génère une équation (addition, soustraction, multiplication, division...) selon les réglages actifs
let choixCompteur=1;
function creerEquation(val,posMot,posLettre) {
posMot+=1;
posLettre+=1;
// Appel : eqElem.innerHTML = creerEquation(val,index,i);
let typesDisponibles = reglages.filter(obj => obj.valeur).map(obj => obj.id);
if (typesDisponibles.length === 0) {
document.getElementById("equation").textContent = "Aucune opération activée.";
return;
}
let choix=typesDisponibles[choixCompteur%(typesDisponibles.length)];
choixCompteur++;
let a, b, c, d,e,f, res, eq, prem;
switch (choix) {
case "LectureDirecte":
eq = `${val} →`;
prem=val;
res = alphabetFR[prem-1];
break;
case "Add-TresSimple":
if (val <= 10) {
a = randFakeInt(1, val,posMot,posLettre,val);
b = val - a;
} else {
a = (val <= 20) ? 10 : 10 * Math.floor(val / 10);
b = val - a;
}
eq = `${a} + ${b} =`;
res = val;
prem=res;
break;
case "XXXplusYYYmoinsZZZ":
a = randFakeInt(25, 499,posMot,posLettre,val);
b = randFakeInt(25, 399,posMot,posLettre,val);
c = a + b - val;
eq = `${a} + ${b} - ${c} =`;
res = a + b - c;
prem=res;
break;
case "ZfoisXXmoinsYY":
a = randFakeInt(11, 29,posMot,posLettre,val);
b = randFakeInt(2, 9,posMot,posLettre,val);
c = a * b - val;
eq = `${a} × ${b} - ${c} =`;
res = a * b - c;
prem=res;
break;
case "ZZmoinsYY":
c=70 - val;
b = randFakeInt(1, c,posMot,posLettre,val);
a = val + b;
eq = `${a} - ${b} =`;
res = val;
prem=res;
break;
case "Sous-TresSimple":
a = val < 10 ? 10 : val < 20 ? 20 : val < 30 ? 30 : val < 40 ? 40 : 50;
b = a - val;
eq = `${a} - ${b} =`;
res = val;
prem=res;
break;
case "DivisionPar2":
a = val * 2;
eq = `${a} ÷ 2 =`;
res = val;
prem=res;
break;
case "DivisionPar4":
a = val * 4;
eq = `${a} ÷ 4 =`;
res = val;
prem=res;
break;
}
let letos = alphabetFR[prem-1];
// Lettre correspondant au résultat
return `