diff --git a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
index bb0c80426bf..00bcc81def5 100644
--- a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
+++ b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
@@ -1,16 +1,20 @@
---
id: 62a8d1c72e8bb13c2074d93c
-title: Step 97
+title: Step 98
challengeType: 0
-dashedName: step-97
+dashedName: step-98
---
# --description--
-You now have an error to fix. The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
+When you were testing your function, you should have seen an error message in the console. This error is due to the condition in the `buyWeapon` function.
+
+The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
Change the `if` condition to check `weapons.length - 1`, instead of `weapons.length`.
+Test out your `buyWeapon` function again to see the error message disappear.
+
# --hints--
You should update the condition to subtract `1` from `weapons.length`.
@@ -42,7 +46,7 @@ assert.match(buyWeapon.toString(), /currentWeapon\s*<\s*weapons\.length\s*-\s*1/
XP: 0Health: 100
- Gold: 50
+ Gold: 250
@@ -113,7 +117,7 @@ button {
```js
let xp = 0;
let health = 100;
-let gold = 50;
+let gold = 250;
let currentWeapon = 0;
let fighting;
let monsterHealth;
diff --git a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
index 686a0495baa..88e988b4342 100644
--- a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
+++ b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
@@ -1,14 +1,18 @@
---
id: 62a8d2146a3e853d0a6e28ca
-title: Step 98
+title: Step 99
challengeType: 0
-dashedName: step-98
+dashedName: step-99
---
# --description--
+If the player has purchased all of the weapons in the inventory, the player should not be able to purchase any more and a message should be displayed.
+
Add an `else` statement for your outer `if` statement. Inside this new `else` statement, set `text.innerText` to `"You already have the most powerful weapon!"`.
+Test your `buyWeapon` function again to make sure the message is displayed when the player has the most powerful weapon.
+
# --hints--
You should have another `else` statement in your `buyWeapon` function.
@@ -49,7 +53,7 @@ assert.equal(text.innerText, "You already have the most powerful weapon!");
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 50;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
new file mode 100644
index 00000000000..124c16a7e0b
--- /dev/null
+++ b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
@@ -0,0 +1,223 @@
+---
+id: 662fc372da60030ae25b194e
+title: Step 100
+challengeType: 0
+dashedName: step-100
+---
+
+# --description--
+
+Now that you are finished testing that portion of the `buyWeapon` function, you can set your `gold` variable back to `50`.
+
+*Note*: The HTML has already been updated to reflect the original value of `gold`.
+
+# --hints--
+
+Your `gold` variable should be set to `50`.
+
+```js
+assert.equal(gold, 50);
+```
+
+# --seed--
+
+## --seed-contents--
+
+```html
+
+
+
+
+
+ RPG - Dragon Repeller
+
+
+
+
+ XP: 0
+ Health: 100
+ Gold: 50
+
+
+
+
+
+
+
+ Monster Name:
+ Health:
+
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 250;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length - 1) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ } else {
+ text.innerText = "You already have the most powerful weapon!";
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
index d4fc28150bd..2cd2267b31c 100644
--- a/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
+++ b/curriculum/challenges/arabic/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
@@ -9,7 +9,7 @@ dashedName: step-6
Whenever an event listener is triggered by an event, an event object is created automatically. You don't always need to use this object, like with your `click` handler above, but it can be useful to access information about the event that was triggered.
-First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body your callback function.
+First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body of your callback function.
# --hints--
diff --git a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
index bb0c80426bf..00bcc81def5 100644
--- a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
+++ b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
@@ -1,16 +1,20 @@
---
id: 62a8d1c72e8bb13c2074d93c
-title: Step 97
+title: Step 98
challengeType: 0
-dashedName: step-97
+dashedName: step-98
---
# --description--
-You now have an error to fix. The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
+When you were testing your function, you should have seen an error message in the console. This error is due to the condition in the `buyWeapon` function.
+
+The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
Change the `if` condition to check `weapons.length - 1`, instead of `weapons.length`.
+Test out your `buyWeapon` function again to see the error message disappear.
+
# --hints--
You should update the condition to subtract `1` from `weapons.length`.
@@ -42,7 +46,7 @@ assert.match(buyWeapon.toString(), /currentWeapon\s*<\s*weapons\.length\s*-\s*1/
XP: 0Health: 100
- Gold: 50
+ Gold: 250
@@ -113,7 +117,7 @@ button {
```js
let xp = 0;
let health = 100;
-let gold = 50;
+let gold = 250;
let currentWeapon = 0;
let fighting;
let monsterHealth;
diff --git a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
index 686a0495baa..88e988b4342 100644
--- a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
+++ b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
@@ -1,14 +1,18 @@
---
id: 62a8d2146a3e853d0a6e28ca
-title: Step 98
+title: Step 99
challengeType: 0
-dashedName: step-98
+dashedName: step-99
---
# --description--
+If the player has purchased all of the weapons in the inventory, the player should not be able to purchase any more and a message should be displayed.
+
Add an `else` statement for your outer `if` statement. Inside this new `else` statement, set `text.innerText` to `"You already have the most powerful weapon!"`.
+Test your `buyWeapon` function again to make sure the message is displayed when the player has the most powerful weapon.
+
# --hints--
You should have another `else` statement in your `buyWeapon` function.
@@ -49,7 +53,7 @@ assert.equal(text.innerText, "You already have the most powerful weapon!");
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 50;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
new file mode 100644
index 00000000000..124c16a7e0b
--- /dev/null
+++ b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
@@ -0,0 +1,223 @@
+---
+id: 662fc372da60030ae25b194e
+title: Step 100
+challengeType: 0
+dashedName: step-100
+---
+
+# --description--
+
+Now that you are finished testing that portion of the `buyWeapon` function, you can set your `gold` variable back to `50`.
+
+*Note*: The HTML has already been updated to reflect the original value of `gold`.
+
+# --hints--
+
+Your `gold` variable should be set to `50`.
+
+```js
+assert.equal(gold, 50);
+```
+
+# --seed--
+
+## --seed-contents--
+
+```html
+
+
+
+
+
+ RPG - Dragon Repeller
+
+
+
+
+ XP: 0
+ Health: 100
+ Gold: 50
+
+
+
+
+
+
+
+ Monster Name:
+ Health:
+
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 250;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length - 1) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ } else {
+ text.innerText = "You already have the most powerful weapon!";
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
index fe20e252772..d59ed77e2e7 100644
--- a/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
+++ b/curriculum/challenges/chinese-traditional/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
@@ -9,7 +9,7 @@ dashedName: step-6
Whenever an event listener is triggered by an event, an event object is created automatically. You don't always need to use this object, like with your `click` handler above, but it can be useful to access information about the event that was triggered.
-First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body your callback function.
+First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body of your callback function.
# --hints--
diff --git a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
index bb0c80426bf..00bcc81def5 100644
--- a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
+++ b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
@@ -1,16 +1,20 @@
---
id: 62a8d1c72e8bb13c2074d93c
-title: Step 97
+title: Step 98
challengeType: 0
-dashedName: step-97
+dashedName: step-98
---
# --description--
-You now have an error to fix. The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
+When you were testing your function, you should have seen an error message in the console. This error is due to the condition in the `buyWeapon` function.
+
+The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
Change the `if` condition to check `weapons.length - 1`, instead of `weapons.length`.
+Test out your `buyWeapon` function again to see the error message disappear.
+
# --hints--
You should update the condition to subtract `1` from `weapons.length`.
@@ -42,7 +46,7 @@ assert.match(buyWeapon.toString(), /currentWeapon\s*<\s*weapons\.length\s*-\s*1/
XP: 0Health: 100
- Gold: 50
+ Gold: 250
@@ -113,7 +117,7 @@ button {
```js
let xp = 0;
let health = 100;
-let gold = 50;
+let gold = 250;
let currentWeapon = 0;
let fighting;
let monsterHealth;
diff --git a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
index 686a0495baa..88e988b4342 100644
--- a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
+++ b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
@@ -1,14 +1,18 @@
---
id: 62a8d2146a3e853d0a6e28ca
-title: Step 98
+title: Step 99
challengeType: 0
-dashedName: step-98
+dashedName: step-99
---
# --description--
+If the player has purchased all of the weapons in the inventory, the player should not be able to purchase any more and a message should be displayed.
+
Add an `else` statement for your outer `if` statement. Inside this new `else` statement, set `text.innerText` to `"You already have the most powerful weapon!"`.
+Test your `buyWeapon` function again to make sure the message is displayed when the player has the most powerful weapon.
+
# --hints--
You should have another `else` statement in your `buyWeapon` function.
@@ -49,7 +53,7 @@ assert.equal(text.innerText, "You already have the most powerful weapon!");
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 50;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
new file mode 100644
index 00000000000..124c16a7e0b
--- /dev/null
+++ b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
@@ -0,0 +1,223 @@
+---
+id: 662fc372da60030ae25b194e
+title: Step 100
+challengeType: 0
+dashedName: step-100
+---
+
+# --description--
+
+Now that you are finished testing that portion of the `buyWeapon` function, you can set your `gold` variable back to `50`.
+
+*Note*: The HTML has already been updated to reflect the original value of `gold`.
+
+# --hints--
+
+Your `gold` variable should be set to `50`.
+
+```js
+assert.equal(gold, 50);
+```
+
+# --seed--
+
+## --seed-contents--
+
+```html
+
+
+
+
+
+ RPG - Dragon Repeller
+
+
+
+
+ XP: 0
+ Health: 100
+ Gold: 50
+
+
+
+
+
+
+
+ Monster Name:
+ Health:
+
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 250;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length - 1) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ } else {
+ text.innerText = "You already have the most powerful weapon!";
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
index a33a7f0d626..f1f35af0acf 100644
--- a/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
+++ b/curriculum/challenges/chinese/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
@@ -9,7 +9,7 @@ dashedName: step-6
Whenever an event listener is triggered by an event, an event object is created automatically. You don't always need to use this object, like with your `click` handler above, but it can be useful to access information about the event that was triggered.
-First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body your callback function.
+First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body of your callback function.
# --hints--
diff --git a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
index bb0c80426bf..00bcc81def5 100644
--- a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
+++ b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
@@ -1,16 +1,20 @@
---
id: 62a8d1c72e8bb13c2074d93c
-title: Step 97
+title: Step 98
challengeType: 0
-dashedName: step-97
+dashedName: step-98
---
# --description--
-You now have an error to fix. The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
+When you were testing your function, you should have seen an error message in the console. This error is due to the condition in the `buyWeapon` function.
+
+The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. The index of the last element in an array is one less than the length of the array.
Change the `if` condition to check `weapons.length - 1`, instead of `weapons.length`.
+Test out your `buyWeapon` function again to see the error message disappear.
+
# --hints--
You should update the condition to subtract `1` from `weapons.length`.
@@ -42,7 +46,7 @@ assert.match(buyWeapon.toString(), /currentWeapon\s*<\s*weapons\.length\s*-\s*1/
XP: 0Health: 100
- Gold: 50
+ Gold: 250
@@ -113,7 +117,7 @@ button {
```js
let xp = 0;
let health = 100;
-let gold = 50;
+let gold = 250;
let currentWeapon = 0;
let fighting;
let monsterHealth;
diff --git a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
index 686a0495baa..88e988b4342 100644
--- a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
+++ b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
@@ -1,14 +1,18 @@
---
id: 62a8d2146a3e853d0a6e28ca
-title: Step 98
+title: Step 99
challengeType: 0
-dashedName: step-98
+dashedName: step-99
---
# --description--
+If the player has purchased all of the weapons in the inventory, the player should not be able to purchase any more and a message should be displayed.
+
Add an `else` statement for your outer `if` statement. Inside this new `else` statement, set `text.innerText` to `"You already have the most powerful weapon!"`.
+Test your `buyWeapon` function again to make sure the message is displayed when the player has the most powerful weapon.
+
# --hints--
You should have another `else` statement in your `buyWeapon` function.
@@ -49,7 +53,7 @@ assert.equal(text.innerText, "You already have the most powerful weapon!");
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 50;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
new file mode 100644
index 00000000000..124c16a7e0b
--- /dev/null
+++ b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
@@ -0,0 +1,223 @@
+---
+id: 662fc372da60030ae25b194e
+title: Step 100
+challengeType: 0
+dashedName: step-100
+---
+
+# --description--
+
+Now that you are finished testing that portion of the `buyWeapon` function, you can set your `gold` variable back to `50`.
+
+*Note*: The HTML has already been updated to reflect the original value of `gold`.
+
+# --hints--
+
+Your `gold` variable should be set to `50`.
+
+```js
+assert.equal(gold, 50);
+```
+
+# --seed--
+
+## --seed-contents--
+
+```html
+
+
+
+
+
+ RPG - Dragon Repeller
+
+
+
+
+ XP: 0
+ Health: 100
+ Gold: 50
+
+
+
+
+
+
+
+ Monster Name:
+ Health:
+
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 250;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length - 1) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ } else {
+ text.innerText = "You already have the most powerful weapon!";
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
index de9c09ea44f..91ca0532a41 100644
--- a/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
+++ b/curriculum/challenges/espanol/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
@@ -9,7 +9,7 @@ dashedName: step-6
Whenever an event listener is triggered by an event, an event object is created automatically. You don't always need to use this object, like with your `click` handler above, but it can be useful to access information about the event that was triggered.
-First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body your callback function.
+First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body of your callback function.
# --hints--
diff --git a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
index 64d60345868..e16a8da4abf 100644
--- a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
+++ b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
@@ -1,16 +1,20 @@
---
id: 62a8d1c72e8bb13c2074d93c
-title: Step 97
+title: Step 98
challengeType: 0
-dashedName: step-97
+dashedName: step-98
---
# --description--
-Du hast nun einen Fehler zu beheben. The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. Der Index des letzten Elements in einem Array ist einen Wert kleiner als die Länge des Arrays.
+When you were testing your function, you should have seen an error message in the console. This error is due to the condition in the `buyWeapon` function.
+
+The `currentWeapon` variable is the index of the `weapons` array, but array indexing starts at zero. Der Index des letzten Elements in einem Array ist einen Wert kleiner als die Länge des Arrays.
Ändere die `if`-Bedingung so, dass sie `weapons.length - 1` statt `weapons.length` überprüft.
+Test out your `buyWeapon` function again to see the error message disappear.
+
# --hints--
Du solltest die Bedingung aktualisieren, um `1` von `weapons.length` zu subtrahieren.
@@ -42,7 +46,7 @@ assert.match(buyWeapon.toString(), /currentWeapon\s*<\s*weapons\.length\s*-\s*1/
XP: 0Health: 100
- Gold: 50
+ Gold: 250
@@ -113,7 +117,7 @@ button {
```js
let xp = 0;
let health = 100;
-let gold = 50;
+let gold = 250;
let currentWeapon = 0;
let fighting;
let monsterHealth;
diff --git a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
index 1aa234b57ce..3e6b0e8ff8a 100644
--- a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
+++ b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
@@ -1,14 +1,18 @@
---
id: 62a8d2146a3e853d0a6e28ca
-title: Step 98
+title: Step 99
challengeType: 0
-dashedName: step-98
+dashedName: step-99
---
# --description--
+If the player has purchased all of the weapons in the inventory, the player should not be able to purchase any more and a message should be displayed.
+
Füge eine `else`-Anweisung für deine äußere `if`-Anweisung hinzu. Setze in dieser neuen `else`-Anweisung `text.innerText` auf `"You already have the most powerful weapon!"`.
+Test your `buyWeapon` function again to make sure the message is displayed when the player has the most powerful weapon.
+
# --hints--
Du solltest eine weitere `else`-Anweisung in deiner `buyWeapon`-Funktion haben.
@@ -49,7 +53,7 @@ assert.equal(text.innerText, "You already have the most powerful weapon!");
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 50;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
new file mode 100644
index 00000000000..124c16a7e0b
--- /dev/null
+++ b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
@@ -0,0 +1,223 @@
+---
+id: 662fc372da60030ae25b194e
+title: Step 100
+challengeType: 0
+dashedName: step-100
+---
+
+# --description--
+
+Now that you are finished testing that portion of the `buyWeapon` function, you can set your `gold` variable back to `50`.
+
+*Note*: The HTML has already been updated to reflect the original value of `gold`.
+
+# --hints--
+
+Your `gold` variable should be set to `50`.
+
+```js
+assert.equal(gold, 50);
+```
+
+# --seed--
+
+## --seed-contents--
+
+```html
+
+
+
+
+
+ RPG - Dragon Repeller
+
+
+
+
+ XP: 0
+ Health: 100
+ Gold: 50
+
+
+
+
+
+
+
+ Monster Name:
+ Health:
+
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 250;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length - 1) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ } else {
+ text.innerText = "You already have the most powerful weapon!";
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
index 690156756dd..1585512503a 100644
--- a/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
+++ b/curriculum/challenges/german/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
@@ -9,7 +9,7 @@ dashedName: step-6
Whenever an event listener is triggered by an event, an event object is created automatically. You don't always need to use this object, like with your `click` handler above, but it can be useful to access information about the event that was triggered.
-First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body your callback function.
+First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body of your callback function.
# --hints--
diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
index b2ce079199d..69a9e7fbc7a 100644
--- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
+++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d1c72e8bb13c2074d93c.md
@@ -1,16 +1,20 @@
---
id: 62a8d1c72e8bb13c2074d93c
-title: Step 97
+title: Step 98
challengeType: 0
-dashedName: step-97
+dashedName: step-98
---
# --description--
-Ora hai un errore da correggere. La variabile `currentWeapon` è l'indice dell'array `weapons`, ma la numerazione degli array parte da zero. L'indice dell'ultimo elemento in un array è inferiore della lunghezza dell'array di uno.
+When you were testing your function, you should have seen an error message in the console. This error is due to the condition in the `buyWeapon` function.
+
+La variabile `currentWeapon` è l'indice dell'array `weapons`, ma la numerazione degli array parte da zero. L'indice dell'ultimo elemento in un array è inferiore della lunghezza dell'array di uno.
Cambia la condizione `if` per verificare `weapons.length - 1`, invece di `weapons.length`.
+Test out your `buyWeapon` function again to see the error message disappear.
+
# --hints--
Dovresti aggiornare la condizione sottraendo `1` da `weapons.length`.
@@ -42,7 +46,7 @@ assert.match(buyWeapon.toString(), /currentWeapon\s*<\s*weapons\.length\s*-\s*1/
XP: 0Health: 100
- Gold: 50
+ Gold: 250
@@ -113,7 +117,7 @@ button {
```js
let xp = 0;
let health = 100;
-let gold = 50;
+let gold = 250;
let currentWeapon = 0;
let fighting;
let monsterHealth;
diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
index 87969827c94..03445a397e0 100644
--- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
+++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/62a8d2146a3e853d0a6e28ca.md
@@ -1,14 +1,18 @@
---
id: 62a8d2146a3e853d0a6e28ca
-title: Step 98
+title: Step 99
challengeType: 0
-dashedName: step-98
+dashedName: step-99
---
# --description--
+If the player has purchased all of the weapons in the inventory, the player should not be able to purchase any more and a message should be displayed.
+
Aggiungi un'istruzione `else` per l'istruzione `if` esterna. Inside this new `else` statement, set `text.innerText` to `"You already have the most powerful weapon!"`.
+Test your `buyWeapon` function again to make sure the message is displayed when the player has the most powerful weapon.
+
# --hints--
Dovresti avere un'altra istruzione `else` nella funzione `buyWeapon`.
@@ -49,7 +53,7 @@ assert.equal(text.innerText, "You already have the most powerful weapon!");
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 50;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
new file mode 100644
index 00000000000..124c16a7e0b
--- /dev/null
+++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-basic-javascript-by-building-a-role-playing-game/662fc372da60030ae25b194e.md
@@ -0,0 +1,223 @@
+---
+id: 662fc372da60030ae25b194e
+title: Step 100
+challengeType: 0
+dashedName: step-100
+---
+
+# --description--
+
+Now that you are finished testing that portion of the `buyWeapon` function, you can set your `gold` variable back to `50`.
+
+*Note*: The HTML has already been updated to reflect the original value of `gold`.
+
+# --hints--
+
+Your `gold` variable should be set to `50`.
+
+```js
+assert.equal(gold, 50);
+```
+
+# --seed--
+
+## --seed-contents--
+
+```html
+
+
+
+
+
+ RPG - Dragon Repeller
+
+
+
+
+ XP: 0
+ Health: 100
+ Gold: 50
+
+
+
+
+
+
+
+ Monster Name:
+ Health:
+
+
+ Welcome to Dragon Repeller. You must defeat the dragon that is preventing people from leaving the town. You are in the town square. Where do you want to go? Use the buttons above.
+
+
+
+
+
+```
+
+```css
+body {
+ background-color: #0a0a23;
+}
+
+#text {
+ background-color: #0a0a23;
+ color: #ffffff;
+ padding: 10px;
+}
+
+#game {
+ max-width: 500px;
+ max-height: 400px;
+ background-color: #ffffff;
+ color: #ffffff;
+ margin: 30px auto 0px;
+ padding: 10px;
+}
+
+#controls,
+#stats {
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #0a0a23;
+}
+
+#monsterStats {
+ display: none;
+ border: 1px solid #0a0a23;
+ padding: 5px;
+ color: #ffffff;
+ background-color: #c70d0d;
+}
+
+.stat {
+ padding-right: 10px;
+}
+
+button {
+ cursor: pointer;
+ color: #0a0a23;
+ background-color: #feac32;
+ background-image: linear-gradient(#fecc4c, #ffac33);
+ border: 3px solid #feac32;
+}
+```
+
+```js
+let xp = 0;
+let health = 100;
+--fcc-editable-region--
+let gold = 250;
+--fcc-editable-region--
+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 weapons = [
+ { name: 'stick', power: 5 },
+ { name: 'dagger', power: 30 },
+ { name: 'claw hammer', power: 50 },
+ { name: 'sword', power: 100 }
+];
+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": [fightSlime, fightBeast, goTown],
+ text: "You enter the cave. You see some monsters."
+ }
+];
+
+// initialize buttons
+button1.onclick = goStore;
+button2.onclick = goCave;
+button3.onclick = fightDragon;
+
+function update(location) {
+ button1.innerText = location["button text"][0];
+ button2.innerText = location["button text"][1];
+ button3.innerText = location["button text"][2];
+ button1.onclick = location["button functions"][0];
+ button2.onclick = location["button functions"][1];
+ button3.onclick = location["button functions"][2];
+ text.innerText = location.text;
+}
+
+function goTown() {
+ update(locations[0]);
+}
+
+function goStore() {
+ update(locations[1]);
+}
+
+function goCave() {
+ update(locations[2]);
+}
+
+function fightDragon() {
+ console.log("Fighting dragon.");
+}
+
+function buyHealth() {
+ if (gold >= 10) {
+ gold -= 10;
+ health += 10;
+ goldText.innerText = gold;
+ healthText.innerText = health;
+ } else {
+ text.innerText = "You do not have enough gold to buy health.";
+ }
+}
+
+function buyWeapon() {
+ if (currentWeapon < weapons.length - 1) {
+ if (gold >= 30) {
+ gold -= 30;
+ currentWeapon++;
+ goldText.innerText = gold;
+ let newWeapon = weapons[currentWeapon].name;
+ text.innerText = "You now have a " + newWeapon + ".";
+ inventory.push(newWeapon);
+ text.innerText += " In your inventory you have: " + inventory;
+ } else {
+ text.innerText = "You do not have enough gold to buy a weapon.";
+ }
+ } else {
+ text.innerText = "You already have the most powerful weapon!";
+ }
+}
+
+
+function fightSlime() {
+
+}
+
+function fightBeast() {
+
+}
+```
diff --git a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
index cbc34986ef5..9e17c8cc2bd 100644
--- a/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
+++ b/curriculum/challenges/italian/15-javascript-algorithms-and-data-structures-22/learn-recursion-by-building-a-decimal-to-binary-converter/6448fefcd6445d6b3d9d63db.md
@@ -9,7 +9,7 @@ dashedName: step-6
Whenever an event listener is triggered by an event, an event object is created automatically. You don't always need to use this object, like with your `click` handler above, but it can be useful to access information about the event that was triggered.
-First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body your callback function.
+First, pass `e` as a parameter to your callback function. Remember that `e` is a common parameter name for the event object. Next, log `e` to the console in the body of your callback function.
# --hints--
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md
index 587f9839500..fea15f0709f 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc174fcf86c76b9248c6eb2.md
@@ -7,15 +7,15 @@ dashedName: step-1
# --description--
-HTML elements have an opening and closing tag with content in between.
+HTML 要素には開始タグと終了タグがあり、その間に要素の中身 (コンテンツ) が入ります。
-Here is the basic syntax:
+基本的な構文は次のとおりです。
```html
content
```
-The first element you will learn about is the `h1` element. The `h1` element is a heading element and is used for the main heading of a webpage.
+では最初に `h1` 要素について学びます。 `h1` 要素は見出しの要素で、ウェブページのメインの見出しに使われます。
```html
This is a main heading
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md
index c257143ca78..b20d05a4e3c 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc17dc8f86c76b9248c6eb5.md
@@ -9,13 +9,13 @@ dashedName: step-4
コメントを使うと、ブラウザーの表示に影響を及ぼさずにメッセージを残すことができます。 また、コメントを使ってコードを非アクティブにすることも可能です。 HTML のコメントは `` で終了します。
-Here is an example of a comment with the `TODO: Remove h1`:
+例えば `TODO: Remove h1` というコメントは次のようになります:
```html
```
-`p` 要素の上に、次のテキストのコメントを追加してください:
+それでは、`p` 要素の上に、次のテキストのコメントを追加してください:
`TODO: Add link to cat photos`
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md
index 84a9d31179d..ab40d125641 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc23991f86c76b9248c6eb8.md
@@ -9,7 +9,7 @@ dashedName: step-6
前のステップで、 `h1` 要素、`h2` 要素、コメント、`p` 要素を `main` 要素の中に入れました。 これを「*ネストする*」といいます。 ネストされた要素は、外側の要素よりもスペース 2 つ分右に配置するようにしましょう。 このスペースはインデント (字下げ) と呼ばれ、HTML を読みやすくする目的で使われます。
-Here is an example of nesting and indentation:
+こちらがネストとインデントの例です:
```html
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md
index 4a9c8222eba..c9d0adff0c7 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24165f86c76b9248c6ebc.md
@@ -9,7 +9,7 @@ dashedName: step-9
`img` 要素には常に `alt` 属性を設定するようにしましょう。 `alt` 属性のテキストは、アクセシビリティを向上させるためスクリーンリーダーに使用されたり、画像の読み込みに失敗した際に表示されたりします。
-Here is an example of an `img` element with an `alt` attribute:
+下記は、`alt` 属性が設定された `img` 要素の例です:
```html
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md
index 5bef4aeb26f..64a70a787e4 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dc24614f86c76b9248c6ebd.md
@@ -7,9 +7,9 @@ dashedName: step-10
# --description--
-You can link to another page with the anchor (`a`) element.
+アンカー (`a`) 要素を使うと、他のページにリンクすることができます。
-Here is an example linking to `https://www.freecodecamp.org`:
+下記は `https://www.freecodecamp.org` にリンクする例です:
```html
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md
index 319d32161a1..1cb88aef33f 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5ddbd81294d8ddc1510a8e56.md
@@ -7,9 +7,9 @@ dashedName: step-11
# --description--
-A link's text must be placed between the opening and closing tags of an anchor (`a`) element.
+リンクのテキストは、アンカー (`a`) 要素の開始タグと終了タグの間に配置します。
-Here is an example of a link with the text `click here to go to freeCodeCamp.org`:
+下記は `click here to go to freeCodeCamp.org` というテキストのリンクの例です。
```html
click here to go to freeCodeCamp.org
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md
index e0717786ca3..84c650f2506 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa2407b521be39a3de7be1.md
@@ -7,11 +7,11 @@ dashedName: step-14
# --description--
-To open links in a new tab, you can use the `target` attribute on the anchor (`a`) element.
+リンクを新しいタブで開くには、アンカー (`a`) 要素に `target` 属性を設定します。
-The `target` attribute specifies where to open the linked document. `target="_blank"` opens the linked document in a new tab or window.
+`target` 属性は、リンクされたドキュメントをどこで開くかを指定します。 `target="_blank"` を指定すると、リンクされたドキュメントは新しいタブまたはウィンドウで開かれます。
-Here is the basic syntax for an `a` element with a `target` attribute:
+`target` 属性を持つ `a` 要素の基本的な構文は次の通りです:
```html
freeCodeCamp
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md
index 81ba79e51fb..48d55fdb2c5 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa30b9eacea3f48c6300ad.md
@@ -9,7 +9,7 @@ dashedName: step-15
以前のステップでは、アンカー要素を使用してテキストをリンクに変換しました。 他の種類のコンテンツも、アンカータグで囲むことでリンクにすることができます。
-Here is an example of turning an image into a link:
+下記は画像をリンクに変換する例です:
```html
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md
index 30f2e71be9e..7f8a52e3e4a 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfa37b9eacea3f48c6300b0.md
@@ -7,7 +7,7 @@ dashedName: step-20
# --description--
-To create an unordered list of items, you can use the `ul` element.
+順序なしリストを作成するには、`ul` 要素を使用します。
テキスト `Things cats love:` を持つ `h3` 要素の後に、順序なしリスト (unordered list、`ul`) 要素を追加してください。 この時点では何も表示されません。
diff --git a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md
index ac4a415c66b..e66cd66b82e 100644
--- a/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md
+++ b/curriculum/challenges/japanese/14-responsive-web-design-22/learn-html-by-building-a-cat-photo-app/5dfb5ecbeacea3f48c6300b1.md
@@ -7,9 +7,9 @@ dashedName: step-21
# --description--
-The `li` element is used to create a list item in an ordered or unordered list.
+順序付きリストまたは順序なしリストのリスト項目を作成するには、`li` 要素を使います。
-Here is an example of list items in an unordered list:
+こちらが順序なしリスト内のリスト項目の例です。
```html