summaryrefslogtreecommitdiff
path: root/lib/scheduling/elimination.rb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-26 22:47:58 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-26 22:47:58 -0400
commitab25aac502a768b6a530ada5c46d6aabe6a56c4c (patch)
treec36e8f6d6fa24f2db907b78b23301fdbd7973b9c /lib/scheduling/elimination.rb
parent2c1e5ab5e7b20dabec9ddb9b34e0cf534afc6d06 (diff)
Added READMEs for scheduling and started seeding in lib.
Diffstat (limited to 'lib/scheduling/elimination.rb')
-rw-r--r--lib/scheduling/elimination.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb
index 074cb5c..4518cff 100644
--- a/lib/scheduling/elimination.rb
+++ b/lib/scheduling/elimination.rb
@@ -33,8 +33,7 @@ module Scheduling
end
end
- def match_finished(match)
- #what in the goddamn fuck does this mean
+ def finish_match(match)
matches = match.tournament_stage.matches_ordered
cur_match_num = matches.invert[match]
unless cur_match_num == 1
@@ -55,17 +54,17 @@ module Scheduling
height = [(matchHeight+50) * logBase**(depth-1) + 100, 500].max;
str = <<-STRING
-<svg version="1.1" baseProfile="full"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- width="100%" height="#{height}">
- <defs>
- <radialGradient id="gradMatch" cx="50%" cy="50%" r="80%" fx="50%" fy="50%">
- <stop offset="0%" style="stop-color:#fff; stop-opacity:1" />
- <stop offset="100%" style="stop-color:#ccc;stop-opacity:0" />
- </radialGradient>
- </defs>
-STRING
+ <svg version="1.1" baseProfile="full"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="100%" height="#{height}">
+ <defs>
+ <radialGradient id="gradMatch" cx="50%" cy="50%" r="80%" fx="50%" fy="50%">
+ <stop offset="0%" style="stop-color:#fff; stop-opacity:1" />
+ <stop offset="100%" style="stop-color:#ccc;stop-opacity:0" />
+ </radialGradient>
+ </defs>
+ STRING
base = 1
pBase = 1
(1..matches.count).each do |i|