Compare commits
No commits in common. "7c9d161719cba280d6df685d1a8549427e6df340" and "926c748eeae7c6d45e73277a4954af655589c7d3" have entirely different histories.
7c9d161719
...
926c748eea
File diff suppressed because it is too large
Load Diff
@ -39,6 +39,8 @@ function stopNotePlaying() {
|
||||
$("#beepLamp").removeClass("lamp-on")
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sleep(ms) {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
@ -135,11 +137,6 @@ function getRandomWord() {
|
||||
return EASY_WORDS[randomIndex];
|
||||
}
|
||||
|
||||
function getRandomMorseWord() {
|
||||
const randomIndex = Math.floor(Math.random() * MORSE_WORDS.length);
|
||||
return MORSE_WORDS[randomIndex];
|
||||
}
|
||||
|
||||
function getRandomEasyWords() {
|
||||
const totalLength = Math.floor(Math.random() * 3) + 2;
|
||||
let finalSentence = ''
|
||||
@ -152,11 +149,11 @@ function getRandomEasyWords() {
|
||||
return finalSentence;
|
||||
}
|
||||
|
||||
function getRandomMorseWords() {
|
||||
function getRandomWords() {
|
||||
const totalLength = Math.floor(Math.random() * 4) + 2;
|
||||
let finalSentence = ''
|
||||
for (let i = 0; i < totalLength; i++) {
|
||||
finalSentence += MORSE_WORDS[Math.floor(Math.random() * MORSE_WORDS.length)];
|
||||
finalSentence += ALL_WORDS[Math.floor(Math.random() * ALL_WORDS.length)];
|
||||
if (i < totalLength - 1) {
|
||||
finalSentence += ' ';
|
||||
}
|
||||
@ -225,12 +222,6 @@ function getTarget() {
|
||||
case 'hard':
|
||||
target = getRandomEasyWords();
|
||||
break;
|
||||
case 'morse-easy':
|
||||
target = getRandomMorseWord();
|
||||
break;
|
||||
case 'morse-hard':
|
||||
target = getRandomMorseWords();
|
||||
break;
|
||||
default:
|
||||
target = getRandomWords();
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user