Skip to content

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.

License

Notifications You must be signed in to change notification settings

annielymariah/ranked-matches-calculator-DIO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 Ranked Matches Calculator 🎮

Description

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.

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 < 10Iron
    • 11 ≤ Victories ≤ 20Bronze
    • 21 ≤ Victories ≤ 50Silver
    • 51 ≤ Victories ≤ 80Gold
    • 81 ≤ Victories ≤ 90Diamond
    • 91 ≤ Victories ≤ 100Legendary
    • Victories ≥ 101Immortal
  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:

  2. Clone this repository:

    git clone https://github.com/annielymariah/ranked-matches-calculator-DIO.git  
  3. Navigate to the project directory:

    cd ranked-matches-calculator-DIO
  4. Install the dependencies:
    Before running the script, install the required dependencies by executing:

    npm install  
  5. Run the script:
    After installing the dependencies, execute the project with:

    npm start  
  6. Interact with the program:
    Input the number of victories and defeats when prompted and view the player's balance and level.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published