Can't select the option to "check my code."

I have been currently working on obtaining my JavaScript certification. Right now I’m step 48 of building my own role playing game with JavaScript, and every time I press the button to check my code it won’t. It won’t tell me if the code is wrong or right, and I have reset the particular step multiple times.

I have tried to run the code in the other material within the curriculum, but it wont even let me do that. Anything help!

You likely have a syntax error? Hard to say though unless you provide your full code and a link to the Step

1 Like

here’s the link url:

js code:

let xp = 0;

let health = 100;

let gold = 50;

let currentWeapon = 0;

let fighting;

let monsterHealth;

let inventory = ["stick"];

const button1 = document.querySelector('#button1');

const button2 = document.querySelector("#button2");

const button3 = document.querySelector("#button3");

const text = document.querySelector("#text");

const xpText = document.querySelector("#xpText");

const healthText = document.querySelector("#healthText");

const goldText = document.querySelector("#goldText");

const monsterStats = document.querySelector("#monsterStats");

const monsterName = document.querySelector("#monsterName");

const monsterHealthText = document.querySelector("#monsterHealth");

// initialize buttons

button1.onclick = goStore;

button2.onclick = goCave;

button3.onclick = fightDragon;

function goTown() {

button1.innerText = "Buy 10 health (10 gold)";

button2.innerText = "Buy weapon (30 gold)";

button3.innerText = "Go to town square";

button1.onclick = buyHealth;

button2.onclick = buyWeapon;

button3.onclick = goTown;

text.innerText = "You enter the store.";

}

function goStore() {

button1.innerText = "Buy 10 health (10 gold)";

button2.innerText = "Buy weapon (30 gold)";

button3.innerText = "Go to town square";

button1.onclick = buyHealth;

button2.onclick = buyWeapon;

button3.onclick = goTown;

text.innerText = "You enter the store.";

}

function goCave() {

console.log("Going to cave.");

}

function fightDragon() {

console.log("Fighting dragon.");

}

function buyHealth() {

}

function buyWeapon() {

}

function goTown() {

}

You have two goTown functions

I promise earlier it def did not let me even run the code to even see if it was wrong

Yeah, major syntax issues can block the test suite sometimes

I guess it happening again?

Link :https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/learn-basic-javascript-by-building-a-role-playing-game/step-55

js code:

let xp = 0;
let health = 100;
let gold = 50;
let currentWeapon = 0;
let fighting;
let monsterHealth;
let inventory = ["stick"];

const button1 = document.querySelector('#button1');
const button2 = document.querySelector("#button2");
const button3 = document.querySelector("#button3");
const text = document.querySelector("#text");
const xpText = document.querySelector("#xpText");
const healthText = document.querySelector("#healthText");
const goldText = document.querySelector("#goldText");
const monsterStats = document.querySelector("#monsterStats");
const monsterName = document.querySelector("#monsterName");
const monsterHealthText = document.querySelector("#monsterHealth");
const locations = [
  {
    name: "town square",
    "button text":
    
  }
];

// initialize buttons
button1.onclick = goStore;
button2.onclick = goCave;
button3.onclick = fightDragon;

function update(location) {

}

function goTown() {
  button1.innerText = "Go to store";
  button2.innerText = "Go to cave";
  button3.innerText = "Fight dragon";
  button1.onclick = goStore;
  button2.onclick = goCave;
  button3.onclick = fightDragon;
  text.innerText = "You are in the town square. You see a sign that says \"Store\".";
}

function goStore() {
  button1.innerText = "Buy 10 health (10 gold)";
  button2.innerText = "Buy weapon (30 gold)";
  button3.innerText = "Go to town square";
  button1.onclick = buyHealth;
  button2.onclick = buyWeapon;
  button3.onclick = goTown;
  text.innerText = "You enter the store.";
}

function goCave() {
  console.log("Going to cave.");
}

function fightDragon() {
  console.log("Fighting dragon.");
}

function buyHealth() {

}

function buyWeapon() {

}

Yes, you have a syntax error here too. It’s best to use the Ask for Help button so it’s easier to help with the code.