diff --git a/script.js b/script.js index b225aee..d72a463 100644 --- a/script.js +++ b/script.js @@ -1,4 +1,4 @@ -const reponse = "train"; +var reponse = ""; var word =""; const good_letter_color = "#8dc689"; const bad_letter_color = "#e57373"; @@ -7,6 +7,8 @@ var free_box = [1,1]; let arrWords; readTextFile("words.txt"); +aleatoire(); + function change_color_good_letter(coord){ coord = "case".concat(coord) console.log(coord) @@ -118,3 +120,9 @@ function verifWord() { } return exist; } + +function aleatoire() { + let rand = Math.floor(Math.random() * arrWords.length); + reponse = arrWords[rand]; + console.log(reponse); +} \ No newline at end of file