diff --git a/ts/dictionnaire.ts b/ts/dictionnaire.ts index 2925778..2c3b2dc 100644 --- a/ts/dictionnaire.ts +++ b/ts/dictionnaire.ts @@ -9,7 +9,7 @@ export default class Dictionnaire { let numeroGrille = Math.floor((aujourdhui - origine) / (24 * 3600 * 1000)); - return MotsATrouver.Liste[numeroGrille]; + return MotsATrouver.Liste[numeroGrille % MotsATrouver.Liste.length]; } public estMotValide(mot: string): boolean { diff --git a/ts/input.ts b/ts/input.ts index 6fefcf7..6571886 100644 --- a/ts/input.ts +++ b/ts/input.ts @@ -27,17 +27,15 @@ export default class Input { if (touche === "Enter") { this.validerMot(); - } else if (touche === "Backspace") { - this.effacerLettre(); } else { this.saisirLettre(touche); } }).bind(this) ); - // Le retour arrière n'est détecté que par keyup + // Le retour arrière n'est détecté que par keydown document.addEventListener( - "keyup", + "keydown", ((event: KeyboardEvent) => { event.stopPropagation(); let touche = event.key;