Skip to content

Latest commit

 

History

History
67 lines (53 loc) · 2.32 KB

README.md

File metadata and controls

67 lines (53 loc) · 2.32 KB

📊 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.