Skip to content
Elo algorithm implementation in JS.
JavaScript
Branch: master
Clone or download

Latest commit

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.flowconfig
.gitignore
.jshintrc
.travis.yml
Gulpfile.js
README.md
index.js
package.json
tests.js

README.md

Elo-js Build Statuselo-js API Documentation

This is a small implemention of the Elo system. Based on wikipeda's information.

Trying to use ES6 features such as class to be fancy.

Installation

npm install elo-js

Usage

Browser

requireJS and browserify compatible.

<script src="elo-js/index.js"></script>

<script>
  var elo = new Elo();

  var player1Rating = 1200;
  var player2Rating = 1250;

  var newPlayer1Rating  = elo.ifWins( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifLoses( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifTies( player1Rating, player2Rating );
</script>

Node

  var Elo = require( 'elo-js' );
  var elo = new Elo();

  var player1Rating = 1200;
  var player2Rating = 1250;

  var newPlayer1Rating  = elo.ifWins( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifLoses( player1Rating, player2Rating );
  newPlayer1Rating      = elo.ifTies( player1Rating, player2Rating );

Contribute

Any idea, remarks? Fill an issue, drop a mail, feel free! ❤️

Build from source

git clone https://github.com/nicolasbrugneaux/elo-js.git
cd elo-js
npm install
gulp # watch src and runs tests
You can’t perform that action at this time.