JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src Added tests, travis, babel and cool stuff Feb 23, 2015
.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