modif lea + marie&laura
This commit is contained in:
parent
8a26fd7207
commit
90e5b07ebe
1 changed files with 43 additions and 0 deletions
43
script.js
43
script.js
|
@ -3,6 +3,7 @@ var word ="";
|
|||
const good_letter_color = "#3fbe00";
|
||||
const bad_letter_color = "#BE0000";
|
||||
const mid_letter_coloer = "#BF8200";
|
||||
var free_box = [1,1];
|
||||
|
||||
function change_color_good_letter(coord){
|
||||
var case_div = document.getElementById(coord);
|
||||
|
@ -22,4 +23,46 @@ function change_color_mid_letter(coord){
|
|||
function update(x) {
|
||||
word += x
|
||||
document.getElementById("message").innerHTML = word;
|
||||
}
|
||||
|
||||
function verifLettres(aWord) {
|
||||
|
||||
let verif = [0,0,0,0,0];
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return verif;
|
||||
}
|
||||
|
||||
function update(x) {
|
||||
word += x;
|
||||
console.log(word);
|
||||
document.getElementById(free_box).innerHTML = x;
|
||||
if (free_box[1]==5) {
|
||||
if (free_box[0]==5) {
|
||||
pass;
|
||||
}
|
||||
else {
|
||||
free_box[0]+=1;
|
||||
free_box[1]=1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
free_box[1]+=1;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue