diff --git a/curriculum/challenges/_meta/learn-basic-javascript-by-building-a-role-playing-game/meta.json b/curriculum/challenges/_meta/learn-basic-javascript-by-building-a-role-playing-game/meta.json index 474405be8b5..70daab75b6b 100644 --- a/curriculum/challenges/_meta/learn-basic-javascript-by-building-a-role-playing-game/meta.json +++ b/curriculum/challenges/_meta/learn-basic-javascript-by-building-a-role-playing-game/meta.json @@ -153,31 +153,31 @@ "title": "Step 35" }, { - "id": "62a3c0ab883fd9435cd5c518", + "id": "62a3c668afc43b4a134cca81", "title": "Step 36" }, { - "id": "62a3c2fccf186146b59c6e96", + "id": "62a3c8bf3980c14c438d2aed", "title": "Step 37" }, { - "id": "62a3c4a0e52767482c5202d4", + "id": "62a3c91a2bab1b4d6fabb726", "title": "Step 38" }, { - "id": "62a3c668afc43b4a134cca81", + "id": "62a3cdb11478a34ff4a6470d", "title": "Step 39" }, { - "id": "62a3c8bf3980c14c438d2aed", + "id": "62a3c0ab883fd9435cd5c518", "title": "Step 40" }, { - "id": "62a3c91a2bab1b4d6fabb726", + "id": "62a3c2fccf186146b59c6e96", "title": "Step 41" }, { - "id": "62a3cdb11478a34ff4a6470d", + "id": "62a3c4a0e52767482c5202d4", "title": "Step 42" }, { diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md index 42cf4b09add..947355db598 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c0ab883fd9435cd5c518.md @@ -1,8 +1,8 @@ --- id: 62a3c0ab883fd9435cd5c518 -title: Step 36 +title: Step 40 challengeType: 0 -dashedName: step-36 +dashedName: step-40 --- # --description-- @@ -141,4 +141,15 @@ const monsterHealthText = document.querySelector("#monsterHealth"); --fcc-editable-region-- --fcc-editable-region-- +function goStore() { + console.log("Going to store."); +} + +function goCave() { + console.log("Going to cave."); +} + +function fightDragon() { + console.log("Fighting dragon."); +} ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md index db5c6088fdc..00ee64d855e 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c2fccf186146b59c6e96.md @@ -1,8 +1,8 @@ --- id: 62a3c2fccf186146b59c6e96 -title: Step 37 +title: Step 41 challengeType: 0 -dashedName: step-37 +dashedName: step-41 --- # --description-- @@ -15,7 +15,7 @@ You can access properties in JavaScript a couple of different ways. The first is button.onclick ``` -Use dot notation to set the `onclick` property of your `button1` to the function reference of `goStore`. This function will be something you write later. Note that `button1` is already declared, so you don't need to use `let` or `const`. +Use dot notation to set the `onclick` property of your `button1` to the function reference of `goStore`. Note that `button1` is already declared, so you don't need to use `let` or `const`. # --hints-- @@ -146,4 +146,15 @@ const monsterHealthText = document.querySelector("#monsterHealth"); // initialize buttons --fcc-editable-region-- +function goStore() { + console.log("Going to store."); +} + +function goCave() { + console.log("Going to cave."); +} + +function fightDragon() { + console.log("Fighting dragon."); +} ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md index 15f48a77a0e..09f2c158b0d 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c4a0e52767482c5202d4.md @@ -1,14 +1,16 @@ --- id: 62a3c4a0e52767482c5202d4 -title: Step 38 +title: Step 42 challengeType: 0 -dashedName: step-38 +dashedName: step-42 --- # --description-- Using the same syntax, set the `onclick` properties of `button2` and `button3` to `goCave` and `fightDragon` respectively. +Once you have done that, open your console and try clicking the buttons on your project. + # --hints-- You should use dot notation to access the `onclick` property of `button2`. @@ -157,4 +159,15 @@ const monsterHealthText = document.querySelector("#monsterHealth"); button1.onclick = goStore; --fcc-editable-region-- +function goStore() { + console.log("Going to store."); +} + +function goCave() { + console.log("Going to cave."); +} + +function fightDragon() { + console.log("Fighting dragon."); +} ``` diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c668afc43b4a134cca81.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c668afc43b4a134cca81.md index d9bf787af0d..7d484553540 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c668afc43b4a134cca81.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c668afc43b4a134cca81.md @@ -1,8 +1,8 @@ --- id: 62a3c668afc43b4a134cca81 -title: Step 39 +title: Step 36 challengeType: 0 -dashedName: step-39 +dashedName: step-36 --- # --description-- @@ -15,14 +15,14 @@ function functionName() { } ``` -Create an empty function named `goStore`. This will match the `goStore` variable you used earlier. +Create an empty function named `goStore`. # --hints-- You should declare `goStore` with the `function` keyword. ```js -assert.match(code, /function\s*goStore()/); +assert.match(code, /function\s+goStore()/); ``` `goStore` should be defined. @@ -148,11 +148,6 @@ 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; - --fcc-editable-region-- --fcc-editable-region-- diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c8bf3980c14c438d2aed.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c8bf3980c14c438d2aed.md index 17a5effcbc8..c5e95a0858c 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c8bf3980c14c438d2aed.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c8bf3980c14c438d2aed.md @@ -1,8 +1,8 @@ --- id: 62a3c8bf3980c14c438d2aed -title: Step 40 +title: Step 37 challengeType: 0 -dashedName: step-40 +dashedName: step-37 --- # --description-- @@ -134,11 +134,6 @@ 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; - --fcc-editable-region-- function goStore() { diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c91a2bab1b4d6fabb726.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c91a2bab1b4d6fabb726.md index ab6751e2e45..a2ded00403c 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c91a2bab1b4d6fabb726.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3c91a2bab1b4d6fabb726.md @@ -1,8 +1,8 @@ --- id: 62a3c91a2bab1b4d6fabb726 -title: Step 41 +title: Step 38 challengeType: 0 -dashedName: step-41 +dashedName: step-38 --- # --description-- @@ -140,11 +140,6 @@ 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 goStore() { console.log("Going to store."); } diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3cdb11478a34ff4a6470d.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3cdb11478a34ff4a6470d.md index 397eebaaff0..6c1eefbe526 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3cdb11478a34ff4a6470d.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a3cdb11478a34ff4a6470d.md @@ -1,16 +1,14 @@ --- id: 62a3cdb11478a34ff4a6470d -title: Step 42 +title: Step 39 challengeType: 0 -dashedName: step-42 +dashedName: step-39 --- # --description-- Now create a `fightDragon` function that prints `Fighting dragon.` to the console. -Once you have done that, open your console and try clicking the buttons on your project. - # --hints-- You should use the `function` keyword to declare `fightDragon`. @@ -142,11 +140,6 @@ 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 goStore() { console.log("Going to store."); }