Skip to content

Commit

Permalink
Fix regex name
Browse files Browse the repository at this point in the history
  • Loading branch information
maysunktong committed Nov 11, 2024
1 parent ed4f7ef commit 453ad12
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const WORD_LIST_PRODUCTS = [
["Farm Products 🚜🌾🥛"],
["wheat", "honey", "bread", "juice", "flour"],
];
const LETTER_REGEXP = /^[a-zæøåäöÆØÅÄÖ]+$/i;
const LETTER_REGEX = /^[a-zæøåäöÆØÅÄÖ]+$/i;
const MAX_WORD_LENGTH = 5;
let maxAttempts = 6;

Expand Down Expand Up @@ -117,7 +117,7 @@ const playGame = () => {
continue;
}

if (!LETTER_REGEXP.test(promptUserGuess)) {
if (!LETTER_REGEX.test(promptUserGuess)) {
alert("Your guess should only include letters!");
continue;
}
Expand Down Expand Up @@ -177,7 +177,7 @@ const startGame = () => {
return startGame();
}

if (!LETTER_REGEXP.test(promptName)) {
if (!LETTER_REGEX.test(promptName)) {
alert("Your name should only contain letters. Please try again.");
return startGame();
}
Expand Down

0 comments on commit 453ad12

Please sign in to comment.