From 1e4042e2387104740dd765a974d675a3c2a87c28 Mon Sep 17 00:00:00 2001 From: Blavignac Leonardo Date: Tue, 6 Dec 2022 16:49:01 +0100 Subject: [PATCH] changes --- index.html | 56 +++++++++++++++++++++++++++--------------------------- script.js | 19 +++++------------- 2 files changed, 33 insertions(+), 42 deletions(-) diff --git a/index.html b/index.html index ee1e175..fdfedad 100644 --- a/index.html +++ b/index.html @@ -16,8 +16,8 @@
-

Q

-

A
+

+

@@ -69,37 +69,37 @@
- - - - - - - - - - + + + + + + + + + +
- - - - - - - - - + + + + + + + + +
- - - - - - - + + + + + + +
diff --git a/script.js b/script.js index cc9379b..1261339 100644 --- a/script.js +++ b/script.js @@ -26,29 +26,20 @@ function update(x) { } function verifLettres(aWord) { - let verif = [0,0,0,0,0]; - for(let i=0 ; i<5; i++) - { + for(let i=0 ; i<5; i++){ if(aWord[i]==reponse[i]) { verif[i]=2; } - else - { - for(let j=0; j<5; j++) - { - if(aWord[i]==reponse[j]) - { - - verif[i]=1; - } + else{ + if(reponse.includes[aWord[i]]){ + verif[i]=1; } } } - return verif; + return verif; } - function update(x) { word += x; console.log(word);