From cb0621f18c625cc59a5a3b9646f8ff050b00c2e1 Mon Sep 17 00:00:00 2001 From: Valentin Duflot Date: Tue, 14 Oct 2025 14:13:45 +0200 Subject: [PATCH] =?UTF-8?q?=20shuffle=20du=20jeu=20=C3=A0=20chaque?= =?UTF-8?q?=20=C3=A9poque?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index af395f4..ddaf386 100644 --- a/index.html +++ b/index.html @@ -678,7 +678,7 @@ const targetDigitSelect = document.getElementById('targetDigit'); const lrLabel = document.getElementById('learningRateLabel'); - let learningRate = 0.5; + let learningRate = 0.5; let desiredDigit = parseInt(targetDigitSelect.value); @@ -901,7 +901,10 @@ let totalErr = 0; // passe sur tous les chiffres - for (let idx = 0; idx < chiffres.length; idx++) { + const indices = [...Array(chiffres.length).keys()]; + indices.sort(() => Math.random() - 0.5); + + for (const idx of indices) { const x = chiffres[idx]; const y = (Math.floor(idx / 10) === desiredDigit) ? 1 : 0; const s = predictSum(x);