Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me to change my assignment include The directional buttons must stil

ID: 3596138 • Letter: P

Question

Please help me to change my assignment include The directional buttons must still work. Playing the game with these should be the same as typing directional commands. Write a function called updateDisplay that takes a parameter called message. This function should add the message to the texarea. (This should already be done from project 2) Write an event handler for each location. In each: Declare a local (aka private) variable called message. Initialize it to a string of descriptive text for that location. Call updateDisplay passing message as a parameter. First picture is my assignment. AT&T; DOCTYPE htm> ctitle Life Game (T*T)tte body t Background-color: #561896; Background-size: 100% 100%; If you do not choose, your life won't advance, but here is only a game Life is a game all people are players or prayers you want to attend the party please touch ca href "mailngl@mat.edu" bere. i id-"myScore"0/span> points!ch3

Explanation / Answer

//Please look through the solution carefully and copy the mentioned code at the respective places..


step-1: //add this function before goToLocation()
function updateDisplay(message) {
document.getElementById('message').value = message;
}

step-2:
function goToLocation() {
......
if(command=="N" || command=="n") {
   updateDisplay("you cut through the courtyard...");
} else if(command=="S" || command=="s") {
   updateDisplay("you lose your life by..");
} else if(command=="E" || command=="e") {
   updateDisplay("yoyu get a ot of wealth..");
} else if(command=="W" || command=="w") {
   updateDisplay("ake up, it is only..");
} else {
   updateDisplay("Enter command " + command + "is not a ..");
}
score +=5;
.....
....