Learn Basic JavaScript by Building a Role Playing Game - Step 130

Tell us what’s happening:

Hola, podrían ayudarme. No encuentro el error en esta operación.

Your code so far

<!-- file: index.html -->

/* file: styles.css */

/* file: script.js */
// User Editable Region

function defeatMonster() {
gold += monsters[fighting].level + Math.floor(Math.random() * 6.7);
} 

// User Editable Region

Your browser information:

El agente de usuario es: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36

Challenge Information:

Learn Basic JavaScript by Building a Role Playing Game - Step 130

Why are you using Math.random?

1 Like

Ya lo pude resolver. No me estaba dando cuenta que tenia que hacer toda la operación adentro de Math.floor();
Gracias!

code removed by moderator

this is the correct one for task 130 cause they say monsters[fighting].level * 6.7

hey @adnanebensouda

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.