Ajout de la touche POINT

This commit is contained in:
JonathanMM 2022-04-24 11:53:48 +02:00
parent 723d94fac7
commit e1f02a666f
2 changed files with 14 additions and 9 deletions

View File

@ -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();

View File

@ -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)