Skip to content

judofyr/glick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glick

Glick is a Ruby implementation of the Glicko rating system.

require 'glick'
g = Glick.new(:tau => 0.5)

p1 = Glick::Player.new(1500, 200)
p2 = Glick::Player.new(1400, 30)
p3 = Glick::Player.new(1550, 100)
p4 = Glick::Player.new(1700, 300)

# Glick#compute takes a a Player and a list of scores.
pl = g.compute(p1, [[p2, 1], [p3, 0], [p4, 0]])
pl.r  # => 1464
pl.rd # => 151

Using a Round object

g = Glick.new
round = Glick::Round.new(g)
round.add_player(1, Glick::Player.new)
round.add_player(2, Glick::Player.new)

# Player 1 won against player 2
round.add_score(1, 2, 1)

round.compute

round.results[1] # => New player object
round.results[2] # => New player object

About

Implementation of Glicko-2 in Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages