From 7214994e339886296d0a192353b19261fd7b69d7 Mon Sep 17 00:00:00 2001 From: Nathan McRae Date: Wed, 8 May 2024 20:50:09 -0700 Subject: [PATCH] Fix bug in submission The common words are lowercase and our submit check didn't account for that (because all the morse shorthands are uppercase) --- morse-code_files/morse-code.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/morse-code_files/morse-code.js b/morse-code_files/morse-code.js index 5366543..32a946d 100644 --- a/morse-code_files/morse-code.js +++ b/morse-code_files/morse-code.js @@ -294,7 +294,7 @@ class ListeningGame { } else { const enteredWord = this.wordInput.value; // console.log('enteredWord: ', enteredWord, 'target: ', this.target); - if (enteredWord.toUpperCase() == this.target) { + if (enteredWord.toUpperCase() == this.target.toUpperCase()) { // If they got the word, show message and switch event listener. this.statusElement.textContent = 'Correct! Press enter to play a new round.'; this.messageFound = true; @@ -617,7 +617,7 @@ class InputGame { // console.log('target: \'' + this.target + '\''); // console.log('this.letterStack.join(\'\'): \'' + this.letterStack.join('') + '\''); // console.log(this.letterStack.join('') == this.target); - if (this.letterStack.join('') == this.target) { + if (this.letterStack.join('').toUpperCase() == this.target.toUpperCase()) { // console.log('match!'); // Clear intervals clearTimeout(this.letterTimeout);