Created
November 20, 2018 20:33
-
-
Save BriceShatzer/ad3b269703fab7209a5da671292ad124 to your computer and use it in GitHub Desktop.
NotedDistantProtocol created by BriceShatzer - https://repl.it/@BriceShatzer/NotedDistantProtocol
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EloCalc = require('elo-calculator'); | |
const elo = new EloCalc({}); | |
// let names = [ | |
// 'Brice Shatzer', | |
// 'Bryce Dorn', | |
// 'Danny Cheng', | |
// 'Jamie Levinson', | |
// 'Joe Duran', | |
// 'Mike Parent', | |
// ]; | |
// let players = {} | |
// playerNames.forEach(function(player) { | |
// players[player] = elo.createPlayer(); | |
// }); | |
const Brice_Shatzer = elo.createPlayer(); | |
Brice_Shatzer.name = 'Brice Shatzer'; | |
const Bryce_Dorn = elo.createPlayer(); | |
Bryce_Dorn.name = 'Bryce Dorn' | |
const Danny_Cheng = elo.createPlayer(); | |
Danny_Cheng.name = 'Danny Cheng'; | |
const Jamie_Levinson = elo.createPlayer(); | |
Jamie_Levinson.name = 'Jamie Levinson'; | |
const Joe_Duran = elo.createPlayer(); | |
Joe_Duran.name = 'Joe Duran'; | |
const Mike_Parent = elo.createPlayer(); | |
Mike_Parent.name = 'Mike Parent'; | |
elo.updateRatings([ | |
[Brice_Shatzer, Bryce_Dorn, 1], | |
[Brice_Shatzer, Bryce_Dorn, 0], | |
[Brice_Shatzer, Danny_Cheng, 1], | |
[Jamie_Levinson, Mike_Parent, 0] | |
]); | |
elo.players.forEach(function(player, i) { | |
console.log(`${player.name} has played ${player.numberOfGamesPlayed} games and has a rating of ${Math.round(player.rating)}`); | |
}); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"requires": true, | |
"lockfileVersion": 1, | |
"dependencies": { | |
"elo-calculator": { | |
"version": "1.0.1", | |
"resolved": "https://registry.npmjs.org/elo-calculator/-/elo-calculator-1.0.1.tgz", | |
"integrity": "sha1-LTLtpwAD0BJNNcYmAbMVP4c3dDk=" | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"main": "index.js", | |
"dependencies": { | |
"elo-calculator": "1.0.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment