Merge pull request #1795 from nemesisridiculii/master

[Bordle] Fix bug in valid word detection
pull/1806/head^2
Gordon Williams 2022-05-09 09:48:37 +01:00 committed by GitHub
commit b8b69cc854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 2 deletions

View File

@ -1,2 +1,3 @@
0.01: New App
0.02: app keeps track of statistics now
0.03: Fix bug in valid word detection

View File

@ -110,7 +110,12 @@ class Wordle {
}
}
addGuess(w) {
if ((this.words.indexOf(w.toLowerCase())%5)!=0) {
let idx = -1;
do{
idx = this.words.indexOf(w.toLowerCase(), idx+1);
}
while(idx !== -1 && idx%5 !== 0);
if(idx%5 !== 0) {
E.showAlert(w+"\nis not a word", "Invalid word").then(function() {
layout = getKeyLayout("");
wordle.render(true);

View File

@ -2,7 +2,7 @@
"name": "Bordle",
"shortName":"Bordle",
"icon": "app.png",
"version":"0.02",
"version":"0.03",
"description": "Bangle version of a popular word search game",
"supports" : ["BANGLEJS2"],
"readme": "README.md",