Role Playing Game Step 75

const locations = [
{
name: “town square”,
“button text”: [“Go to store”, “Go to cave”, “Fight dragon”],
“button functions”: [goStore, goCave, fightDragon],
text: “You are in the town square. You see a sign that says "Store".”
},
{
name: “store”,
“button text”: [“Buy 10 health (10 gold)”, “Buy weapon (30 gold)”, “Go to town square”],
“button functions”: [buyHealth, buyWeapon, goTown],
text: “You enter the store.”
},
{
name: “cave”,
“button text”: [“Fight slime”, “Fight fanged beast”, “Go to town square”],
“button functions”: [goSlime, goBeast, goTown],
text: “You enter the cave. You see some monsters.”
}
];

Sorry, your code does not pass. You’re getting there.

You should have three values in your locations array.

Why is it not seeing the third value in the locations array?

Welcome back to the forum @CFIcandoit

Please check the first two variable names for the cave object.

For next time, please use the following method to post code to the forum:

  1. On a separate line type three back ticks.
  2. On a separate line paste your code.
  3. On the last line type three back ticks. Here is a single back tick `

Happy coding

Everything was correct. I tried entering the code a few times and it finally accepted it. I don’t know what the problem was.

goSlime ==> fightSlime
goBeast ==> fightBeast

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.