Professional Documents
Culture Documents
// Generate all the buttons for all the letters in the Alphabet
function generateButton(){
// a(ACII #97) - z(ACII #122)
for( let i = 97; i <= 122; i++){
// Turn ACII # into a character
let letter = String.fromCharCode(i);
// create an new AlphabetButton object and push it into the array
let newButton = new AlphabetButton(letter);
listOfButtons.push(newButton);
}
}
// Checks button pressed, if the corresponding letter exists in the hidden word
function checkForLetter(){
}
// If user makes a wrong guess, increment guess variable
function guessWrong(){
guess++
// Checks guess variable, user can only have 7 guesses
if(guess > 7) {
alert("GAME OVER!");
}
}
generateButton();