From 72c938c505e6c159d824c6d555779fe1a9eba071 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Tue, 22 Apr 2014 17:33:02 -0400 Subject: Added all the folders to lib --- lib/scoring_algorithms/FibonacciPeerWithBlowout.rb | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 lib/scoring_algorithms/FibonacciPeerWithBlowout.rb (limited to 'lib/scoring_algorithms/FibonacciPeerWithBlowout.rb') diff --git a/lib/scoring_algorithms/FibonacciPeerWithBlowout.rb b/lib/scoring_algorithms/FibonacciPeerWithBlowout.rb deleted file mode 100644 index 19ac9a7..0000000 --- a/lib/scoring_algorithms/FibonacciPeerWithBlowout.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'ScoringAlgorithm' - -class FibonacciPeerWithBlowout < ScoringAlgorithm - - def self.score(match, interface) - match.players.each do |player| - scores[player.user_name] = scoreUser(interface.getStatistic(match, player, :votes), match.win?(player), match.blowout) - end - scores - end - - def self.scoreUser(votes, win, blowout) - fibonacci = Hash.new { |h,k| h[k] = k < 2 ? k : h[k-1] + h[k-2] } - fibonacci[votes+3] + (win ? blowout ? 12 : 10 : blowout ? 5 : 7) - end -end \ No newline at end of file -- cgit v1.2.3-2-g168b