tournament 3.2.2 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/README.rdoc +1 -1
- data/Rakefile +1 -1
- data/lib/tournament.rb +1 -1
- data/lib/tournament/pool.rb +90 -0
- data/webgui/app/views/reports/_leader.html.erb +8 -2
- data/webgui/app/views/shared/_bracket.html.erb +1 -1
- metadata +5 -5
data/History.txt
CHANGED
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
data/lib/tournament.rb
CHANGED
data/lib/tournament/pool.rb
CHANGED
@@ -278,6 +278,96 @@ class Tournament::Pool
|
|
278
278
|
return pool
|
279
279
|
end
|
280
280
|
|
281
|
+
# Creates a Pool object for the 2010 NCAA tournament
|
282
|
+
def self.ncaa_2010
|
283
|
+
pool = Tournament::Pool.new
|
284
|
+
pool.add_region("Midwest",
|
285
|
+
[
|
286
|
+
Tournament::Team.new('Kansas', 'Kan', 1),
|
287
|
+
Tournament::Team.new('Lehigh', 'Leh', 16),
|
288
|
+
Tournament::Team.new('UNLV', 'ULV', 8),
|
289
|
+
Tournament::Team.new('Northern Iowa', 'NIo', 9),
|
290
|
+
Tournament::Team.new('Michigan St.', 'MSU', 5),
|
291
|
+
Tournament::Team.new('New Mexico State', 'NMS', 12),
|
292
|
+
Tournament::Team.new('Maryland', 'Mry', 4),
|
293
|
+
Tournament::Team.new('Houston', 'Hou', 13),
|
294
|
+
Tournament::Team.new('Tennessee', 'Ten', 6),
|
295
|
+
Tournament::Team.new('San Diego State', 'SDS', 11),
|
296
|
+
Tournament::Team.new('Georgetown', 'GT', 3),
|
297
|
+
Tournament::Team.new('Ohio', 'Ohi', 14),
|
298
|
+
Tournament::Team.new('Oklahoma State', 'OkS', 7),
|
299
|
+
Tournament::Team.new('Georgia Tech', 'GTc', 10),
|
300
|
+
Tournament::Team.new('Ohio State', 'OSU', 2),
|
301
|
+
Tournament::Team.new('UC Santa Barbara', 'SB', 15)
|
302
|
+
],
|
303
|
+
0
|
304
|
+
)
|
305
|
+
pool.add_region("West",
|
306
|
+
[
|
307
|
+
Tournament::Team.new('Syracuse', 'Syr', 1),
|
308
|
+
Tournament::Team.new('Vermont', 'Ver', 16),
|
309
|
+
Tournament::Team.new('Gonzaga', 'Gon', 8),
|
310
|
+
Tournament::Team.new('Florida State', 'FSU', 9),
|
311
|
+
Tournament::Team.new('Butler', 'But', 5),
|
312
|
+
Tournament::Team.new('UTEP', 'UTP', 12),
|
313
|
+
Tournament::Team.new('Vanderbilt', 'Van', 4),
|
314
|
+
Tournament::Team.new('Murray State', 'Mur', 13),
|
315
|
+
Tournament::Team.new('Xavier', 'Xav', 6),
|
316
|
+
Tournament::Team.new('Minnesota', 'Min', 11),
|
317
|
+
Tournament::Team.new('Pittsburgh', 'Pit', 3),
|
318
|
+
Tournament::Team.new('Oakland', 'Oak', 14),
|
319
|
+
Tournament::Team.new('BYU', 'BYU', 7),
|
320
|
+
Tournament::Team.new('Florida', 'Fla', 10),
|
321
|
+
Tournament::Team.new('Kansas St.', 'KSU', 2),
|
322
|
+
Tournament::Team.new('Nort Texas', 'NTx', 15)
|
323
|
+
],
|
324
|
+
1
|
325
|
+
)
|
326
|
+
pool.add_region("East",
|
327
|
+
[
|
328
|
+
Tournament::Team.new('Kentucky', 'Ken', 1),
|
329
|
+
Tournament::Team.new('East Tennessee State', 'ETS', 16),
|
330
|
+
Tournament::Team.new('Texas', 'Tex', 8),
|
331
|
+
Tournament::Team.new('Wake Forest', 'WkF', 9),
|
332
|
+
Tournament::Team.new('Temple', 'Tem', 5),
|
333
|
+
Tournament::Team.new('Cornell', 'Cor', 12),
|
334
|
+
Tournament::Team.new('Wisconsin', 'Wis', 4),
|
335
|
+
Tournament::Team.new('Wofford', 'Wof', 13),
|
336
|
+
Tournament::Team.new('Marquette', 'Mar', 6),
|
337
|
+
Tournament::Team.new('Washington', 'Was', 11),
|
338
|
+
Tournament::Team.new('New Mexico', 'NMx', 3),
|
339
|
+
Tournament::Team.new('Montana', 'Mon', 14),
|
340
|
+
Tournament::Team.new('Clemson', 'Clm', 7),
|
341
|
+
Tournament::Team.new('Missouri', 'Msr', 10),
|
342
|
+
Tournament::Team.new('West Virginia', 'WVa', 2),
|
343
|
+
Tournament::Team.new('Morgan State', 'MgS', 15)
|
344
|
+
],
|
345
|
+
2
|
346
|
+
)
|
347
|
+
pool.add_region("South",
|
348
|
+
[
|
349
|
+
Tournament::Team.new('Duke', 'Duk', 1),
|
350
|
+
Tournament::Team.new('Arkansa-Pine Bluff', 'APB', 16),
|
351
|
+
Tournament::Team.new('California', 'Cal', 8),
|
352
|
+
Tournament::Team.new('Louisville', 'Lou', 9),
|
353
|
+
Tournament::Team.new('Texas A&M', 'A&M', 5),
|
354
|
+
Tournament::Team.new('Utah State', 'USt', 12),
|
355
|
+
Tournament::Team.new('Purdue', 'Pur', 4),
|
356
|
+
Tournament::Team.new('Siena', 'Sie', 13),
|
357
|
+
Tournament::Team.new('Notre Dame', 'ND', 6),
|
358
|
+
Tournament::Team.new('Old Dominion', 'OD', 11),
|
359
|
+
Tournament::Team.new('Baylor', 'Bay', 3),
|
360
|
+
Tournament::Team.new('Sam Houston State', 'SHS', 14),
|
361
|
+
Tournament::Team.new('Richmond', 'Rch', 7),
|
362
|
+
Tournament::Team.new("St. Mary's", 'StM', 10),
|
363
|
+
Tournament::Team.new('Villanova', 'Vil', 2),
|
364
|
+
Tournament::Team.new('Robert Morris', 'RbM', 15)
|
365
|
+
],
|
366
|
+
3
|
367
|
+
)
|
368
|
+
return pool
|
369
|
+
end
|
370
|
+
|
281
371
|
# Run a test pool with random entries and a random outcome.
|
282
372
|
def self.test(num_picks = 20)
|
283
373
|
pool = ncaa_2008
|
@@ -21,6 +21,7 @@
|
|
21
21
|
<td rowspan="2">Current<br/>Score</td>
|
22
22
|
<td rowspan="2">Max Score</td>
|
23
23
|
<td rowspan="2">Entry Name</td>
|
24
|
+
<td rowspan="2">By</td>
|
24
25
|
<td rowspan="2">Champ<br/>Alive?</td>
|
25
26
|
<td rowspan="2">Tie<br/>Break</td>
|
26
27
|
<td colspan="6">Round Scores</td>
|
@@ -36,7 +37,7 @@
|
|
36
37
|
</thead>
|
37
38
|
<tbody>
|
38
39
|
<%
|
39
|
-
|
40
|
+
db_entries = @pool.user_entries.inject({}) {|h,e| h[e.name] = e; h}
|
40
41
|
pool.entries.sort do |e1, e2|
|
41
42
|
s1 = e1.picks.score_against(pool.tournament_entry.picks, pool.scoring_strategy)
|
42
43
|
s2 = e2.picks.score_against(pool.tournament_entry.picks, pool.scoring_strategy)
|
@@ -44,6 +45,10 @@
|
|
44
45
|
s1 = 0 - (e1.tie_breaker - pool.tournament_entry.tie_breaker).abs
|
45
46
|
s2 = 0 - (e2.tie_breaker - pool.tournament_entry.tie_breaker).abs
|
46
47
|
end
|
48
|
+
if s1 == s2
|
49
|
+
s1 = e1.max_score
|
50
|
+
s2 = e2.max_score
|
51
|
+
end
|
47
52
|
s2 <=> s1
|
48
53
|
end.inject(nil) do |last_entry, entry|
|
49
54
|
total = entry.picks.score_against(pool.tournament_entry.picks, pool.scoring_strategy)
|
@@ -65,7 +70,8 @@
|
|
65
70
|
<td><%=rank_display%></td>
|
66
71
|
<td><%=total%></td>
|
67
72
|
<td><%=max%></td>
|
68
|
-
<td><%=link_to entry.name, :controller => 'entry', :action => 'show', :id =>
|
73
|
+
<td><%=link_to entry.name, :controller => 'entry', :action => 'show', :id => db_entries[entry.name].id%></td>
|
74
|
+
<td><%=db_entries[entry.name].user.login%></td>
|
69
75
|
<td><%=champ.short_name%> <%=pool.tournament_entry.picks.still_alive?(champ) ? 'Y' : 'N'%></td>
|
70
76
|
<td><%=entry.tie_breaker || '-'%></td>
|
71
77
|
<% round_scores.each do |rs| %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<%
|
2
|
-
is_editable = defined?(editable) ? editable : (current_user.has_role?(:admin) ||
|
2
|
+
is_editable = defined?(editable) ? editable : (current_user.has_role?(:admin) || (@entry.pool.accepting_entries? && @entry.user == current_user ) )
|
3
3
|
classes = {}
|
4
4
|
ids = {}
|
5
5
|
onclicks = {}
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 3
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 3.
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 3.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Douglas A. Seifert
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-16 00:00:00 -07:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
description: |-
|
77
77
|
Small library, command line program and Rails web GUI for managing a NCAA
|
78
78
|
basketball tournament pool.
|
79
|
-
email: doug
|
79
|
+
email: doug@dseifert.net
|
80
80
|
executables:
|
81
81
|
- benchmark_pool
|
82
82
|
- gui.rb
|