summaryrefslogtreecommitdiff
path: root/lib/scoring_algorithms/Recommended.rb
diff options
context:
space:
mode:
authorLuke Shumaker <shumakl@purdue.edu>2014-04-20 16:03:24 -0400
committerLuke Shumaker <shumakl@purdue.edu>2014-04-20 16:03:24 -0400
commit641b619ae503ea70ea36c75d658f133775379deb (patch)
tree7e663e3a6aa9c8548413737da20c82f87a8459f7 /lib/scoring_algorithms/Recommended.rb
parent49f579f025235045840e17005fd84edc9e12f9eb (diff)
parent16750bab527d574867a64e3092f7335a028195cb (diff)
Merge branch 'master' of github.com:LukeShu/leaguer
Diffstat (limited to 'lib/scoring_algorithms/Recommended.rb')
-rw-r--r--lib/scoring_algorithms/Recommended.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/scoring_algorithms/Recommended.rb b/lib/scoring_algorithms/Recommended.rb
new file mode 100644
index 0000000..8033bd2
--- /dev/null
+++ b/lib/scoring_algorithms/Recommended.rb
@@ -0,0 +1,8 @@
+class Recommended
+ def self.score(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
+
+#puts Recommended.score(4, true, false)