Git Product home page Git Product logo

elo's Introduction

ELO Ranking Application

Ranking Players using Elo algorithm.

Configuration

Given two files:

  1. Players file: Each line has an ID number and a name for that player. File name and location is defined in
    application.properties with the property players.filename. Default value is ./players.txt

  2. Matches file: Each line contains the ID of the two players of a match and the first one is the winner of that match. File name and location is defined in
    application.properties with the property matches.filename Default value is ./matches.txt

How to run the application

Required:

  1. Java 11
  2. Maven

Build the application

mvn clean install

Run application using maven

Example:

mvn spring-boot:run -Dspring-boot.run.arguments="SHOW_DETAILS 13"

Use -Dspring-boot.run.arguments to send different options.

Run jar application

After running mvn clean install jar application elo-0.0.1-SNAPSHOT.jar could be found on ./target directory.

Example:

java -jar target/elo-0.0.1-SNAPSHOT.jar SHOW_DETAILS 13

Where SHOW_DETAILS and 13 are application options.

Application options

  • LIST_PLAYERS: Shows a list of players and their ranking, number of wins and losses. By default, the list is sorted by RANKING. However other sort options could be ID, NAME, RANKING, WINS, LOSSES. it is possible as well to change the sorting direction using the options ASC, DES. By default, the list is sorted by using ASC.

Example: java -jar target/elo-0.0.1-SNAPSHOT.jar LIST_PLAYERS WINS DES

  • SHOW_DETAILS: Shows the player details like ranking, number of wins, losses. Additionally, it shows whom the player won or lost and the number of times. For this option is mandatory a second parameter with the playerId.

Example: java -jar target/elo-0.0.1-SNAPSHOT.jar SHOW_DETAILS 13

  • GENERATE_MATCH: Shows a list of Player ID pairs with suggested matches. Matches are arranged based on player ranking. Matches with similar player rankings will be fun and challenging for the players. A match is generated per player in the list. As the player list might not be even in terms of the number of players, a player might need to play twice.

Runtime configuration options.

Location of the source files players.filename and matches.filename can be changed when running the application.

Example: java -jar target/elo-0.0.1-SNAPSHOT.jar SHOW_DETAILS 13 --players.filename=./new_players_file.txt

For Developers.

  1. Console entry point is io.fysus.elo.CommandRunner class.

  2. Based on the chosen option one of the io.fysus.elo.controller.Controller is executed.

  3. Controllers classes rely on Services implementations in the package io.fysus.elo.service to obtain the information and that information is formatted and reported using one of the implementations of io.fysus.elo.formatter.OutputFormatter

  4. Service Implementation in the package io.fysus.elo.service rely on io.fysus.elo.core.MatchAnalyzer to obtain match and player statistics.

LICENSE

See License

Questions?

Copyright

Copyright (c) 2020 Fredy Sierra

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.