This project is a solution to the "Calculadora de partidas Rankeadas" challenge proposed by the DIO.me course. The goal is to implement a system that calculates a player's ranked match balance and determines their level based on their victories, using fundamental programming concepts such as variables, operators, loops, decision structures, and functions.
The application must:
-
Create a function that:
- Receives as parameters the player's number of victories and defeats.
- Calculates the ranked match balance using the following formula:
balance = victories - defeats
-
Determine the player's level based on the number of victories:
- Victories < 10 → Iron
- 11 ≤ Victories ≤ 20 → Bronze
- 21 ≤ Victories ≤ 50 → Silver
- 51 ≤ Victories ≤ 80 → Gold
- 81 ≤ Victories ≤ 90 → Diamond
- 91 ≤ Victories ≤ 100 → Legendary
- Victories ≥ 101 → Immortal
-
Display a message with the player's balance and level in the following format:
The Hero has a balance of {balance} and is at the level of {level}.
- Variables
- Operators
- Functions
- Loops
- Decision Structures
-
Install Node.js
Make sure Node.js is installed on your computer. If not, download it from the official website: -
Clone this repository:
git clone https://github.com/annielymariah/ranked-matches-calculator-DIO.git
-
Navigate to the project directory:
cd ranked-matches-calculator-DIO
-
Install the dependencies:
Before running the script, install the required dependencies by executing:npm install
-
Run the script:
After installing the dependencies, execute the project with:npm start
-
Interact with the program:
Input the number of victories and defeats when prompted and view the player's balance and level.