diff options
author | tkimia <tkimia@purdue.edu> | 2014-04-26 17:41:03 -0400 |
---|---|---|
committer | tkimia <tkimia@purdue.edu> | 2014-04-26 17:41:03 -0400 |
commit | 1f6e683ba073a8258d31f541bdd4bde76d978f0a (patch) | |
tree | aa54ea7e6bd21761c959353cd91bbc1f763dd2af | |
parent | 78e9616e4e75fb030879e9fb8077d1ee68a67873 (diff) |
rr #matched changed
-rw-r--r-- | lib/scheduling/roundrobin.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/scheduling/roundrobin.rb b/lib/scheduling/roundrobin.rb index 10af20e..e2db2cf 100644 --- a/lib/scheduling/roundrobin.rb +++ b/lib/scheduling/roundrobin.rb @@ -8,12 +8,12 @@ module Scheduling def create_matches num_teams = (self.tournament.players.count/self.tournament.min_players_per_team).floor - num_matches = Float(num_teams/2)*(num_teams-1) + num_matches = (num_teams* Float(num_teams-1)/2).ceil #round robin should look like this @team_pairs = Array.new(num_matches) for i in 0..@match.teams.size - @team_pairs.push(@match.teams[i] + @team_pairs.push(@match.teams[i]) end #team_pairs needs populated with the team objects and im not sure how to do that end @@ -35,7 +35,7 @@ module Scheduling end def graph(current_user) - + end end end |