https://github.com/annielymariah/ranked-matches-calculator-dio
This repository contains the solution to the "Calculadora de Partidas Rankeadas" challenge proposed by DIO.me. The program calculates a player's ranked match balance based on victories and defeats and determines their level, ranging from "Ferro" to "Imortal," according to predefined criteria.
https://github.com/annielymariah/ranked-matches-calculator-dio
javascript nodejs programming-logic
Last synced: 14 days ago
JSON representation
This repository contains the solution to the "Calculadora de Partidas Rankeadas" challenge proposed by DIO.me. The program calculates a player's ranked match balance based on victories and defeats and determines their level, ranging from "Ferro" to "Imortal," according to predefined criteria.
- Host: GitHub
- URL: https://github.com/annielymariah/ranked-matches-calculator-dio
- Owner: annielymariah
- License: mit
- Created: 2024-11-21T02:54:19.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-12-04T03:48:51.000Z (7 months ago)
- Last Synced: 2025-03-28T14:44:18.686Z (3 months ago)
- Topics: javascript, nodejs, programming-logic
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
📊 Ranked Matches Calculator 🎮
### **Description**
This project is a solution to the "Calculadora de partidas Rankeadas" challenge proposed by the **[DIO.me](https://web.dio.me/track/formacao-logica-de-programacao)** 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.## **Challenge Requirements**
The application must:1. 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
```2. 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**3. 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}.
```## **Tools and Concepts Used**
- Variables
- Operators
- Functions
- Loops
- Decision Structures## **How to Run the Project**
1. **Install Node.js**
Make sure **Node.js** is installed on your computer. If not, download it from the official website:
- [Node.js Official Site](https://nodejs.org)2. **Clone this repository**:
```bash
git clone https://github.com/annielymariah/ranked-matches-calculator-DIO.git
```3. **Navigate to the project directory**:
```bash
cd ranked-matches-calculator-DIO
```4. **Install the dependencies**:
Before running the script, install the required dependencies by executing:
```bash
npm install
```5. **Run the script**:
After installing the dependencies, execute the project with:
```bash
npm start
```6. **Interact with the program**:
Input the number of victories and defeats when prompted and view the player's balance and level.