- An implementation of the Elo rating system in JS.
-
R'a = Ra + K(Sa - Ea)
-
R'b = Rb + K(Sb - Eb)
-
R'a/R'b - New ratings of player A and player b
-
Ra/Rb - Old ratings of player A and player b
-
K - "K factor" set it as 32 for now
-
Sa/Sb = Actual score
-
Ea/Eb = Expected score
- Ea = 1/(1 + 10 ^ ((Rb-Ra) / 400) )
- Eb = 1/(1 + 10 ^ ((Ra-Rb) / 400) )
- AngularFire 2.0.2
- Google AngularJS 1.5.8
- Google Firebase 3.4.0
- Bootstrap 3.3.7
- Angular UI for Bootstrap 2.1.3
- JQuery 3.1.0
- Please configure Firebase URL in app/js/config.js before running.
// your Firebase URL goes here
var config = {
apiKey: "AIzaSyATrephRZpug-hcuwhELSx5p4ZGj0xPfdA",
authDomain: "elo-rating.firebaseapp.com",
databaseURL: "https://elo-rating.firebaseio.com",
storageBucket: "elo-rating.appspot.com",
messagingSenderId: "332514913142"
};
-
Set up Email/Password authentication in Firebase.
- Log in to Firebase console, open the Auth section
- On the Sign in method tab, enable the Email/password sign-in method and click Save.
- Add email and password to Users tab
-
Replace line 80 & 81 in app/js/controller.js with your own credentials you just set up.
$scope.email = "admin@mydomain.com";
$scope.password = "password";
- Fork it ( https://github.com/cdeng/elo-rating/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Code released under the MIT license.