Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Javascript Here is this HTML file I'm working with: P5 Word Guess Word: Guess > Start > Letters Guessed I already have both p5.js and

Javascript

Here is this HTML file I'm working with:

P5

Word Guess

Word:

>>

Letters Guessed

I already have both p5.js and p5-word.js

Here is the question for what I must add to p5.js:

At the top of my p5.js I have these variables initialized:

const words = wordsList; //refers to words array from p5-words.js

const guesses = []; //initailized to empty array

const word = ""; //initialized to empty string

Question I need answered:

F. handleStartRestartButtonClick() function

This function either starts, or restarts, the game. This function will:

  • Reset the guesses array to an empty array
  • Change the Start/Restart button to display, "Restart"
  • Update the listing of guessed letters
  • Update the word with underscores display
  • Find a new random word, converted to upper case

Use addEventListener() to connect this function to the appropriate button to handle the click event.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

What are CAATs and techniques?

Answered: 1 week ago

Question

=+professionalism and competency in handling global HR issues?

Answered: 1 week ago