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.
npm install elo-js
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>
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 );
Any idea, remarks? Fill an issue, drop a mail, feel free! ❤️
git clone https://github.com/nicolasbrugneaux/elo-js.git
cd elo-js
npm install
gulp # watch src and runs tests