From e1f02a666ff39044d2be74f9c2cf2636a9769b7e Mon Sep 17 00:00:00 2001 From: JonathanMM Date: Sun, 24 Apr 2022 11:53:48 +0200 Subject: [PATCH] Ajout de la touche POINT --- ts/gestionnaire.ts | 11 ++++++++--- ts/input.ts | 12 ++++++------ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ts/gestionnaire.ts b/ts/gestionnaire.ts index 61d2443..a1d4444 100644 --- a/ts/gestionnaire.ts +++ b/ts/gestionnaire.ts @@ -170,15 +170,20 @@ export default class Gestionnaire { mot = Dictionnaire.nettoyerMot(mot); //console.debug(mot + " => " + (Dictionnaire.estMotValide(mot) ? "Oui" : "non")); if (mot.length !== this._motATrouver.length) { - NotificationMessage.ajouterNotification("Le mot proposé est trop court"); + NotificationMessage.ajouterNotification("Le mot proposé est trop court."); return false; } + if (mot.includes(".")) { + NotificationMessage.ajouterNotification("Votre mot ne doit contenir que des lettres."); + return false; + } + if (mot[0] !== this._motATrouver[0]) { - NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché"); + NotificationMessage.ajouterNotification("Le mot proposé doit commencer par la même lettre que le mot recherché."); return false; } if (!(await Dictionnaire.estMotValide(mot, this._motATrouver[0], this._motATrouver.length))) { - NotificationMessage.ajouterNotification("Ce mot n'est pas dans notre dictionnaire"); + NotificationMessage.ajouterNotification("Ce mot n'est pas dans notre dictionnaire."); return false; } if (!this._datePartieEnCours) this._datePartieEnCours = new Date(); diff --git a/ts/input.ts b/ts/input.ts index b5222d7..f17113c 100644 --- a/ts/input.ts +++ b/ts/input.ts @@ -81,26 +81,26 @@ export default class Input { case ClavierDisposition.Bépo: return [ ["B", "E", "P", "O", "W", "V", "D", "L", "J", "Z"], - ["A", "U", "I", "C", "T", "S", "R", "N", "M"], - ["_effacer", "Y", "X", "K", "Q", "G", "H", "F", "_entree"], + ["A", "U", "I", "E", "C", "T", "S", "R", "N", "M"], + ["_effacer", "Y", "X", ".", "K", "Q", "G", "H", "F", "_entree"], ]; case ClavierDisposition.Qwerty: return [ ["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"], ["A", "S", "D", "F", "G", "H", "J", "K", "L"], - ["_vide", "Z", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"], + [".", "Z", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"], ]; case ClavierDisposition.Qwertz: return [ ["Q", "W", "E", "R", "T", "Z", "U", "I", "O", "P"], ["A", "S", "D", "F", "G", "H", "J", "K", "L"], - ["_vide", "Y", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"], + [".", "Y", "X", "C", "V", "B", "N", "M", "_effacer", "_entree"], ]; default: return [ ["A", "Z", "E", "R", "T", "Y", "U", "I", "O", "P"], ["Q", "S", "D", "F", "G", "H", "J", "K", "L", "M"], - ["_videdouble", "W", "X", "C", "V", "B", "N", "_effacer", "_entree"], + ["_vide", ".", "W", "X", "C", "V", "B", "N", "_effacer", "_entree"], ]; } } @@ -134,7 +134,7 @@ export default class Input { if (touche === "Enter") { this.validerMot(); - } else if (/^[A-Z]$/.test(Dictionnaire.nettoyerMot(touche))) { + } else if (/^[A-Z.]$/.test(Dictionnaire.nettoyerMot(touche))) { this.saisirLettre(touche); } }).bind(this)