1
Fork 0

Slight changes in 'tournament_table.rb'.

master
vonavi 2013-10-06 01:47:40 +03:00
parent b99fcdd160
commit b9c0da19d1
1 changed files with 4 additions and 4 deletions

View File

@ -68,13 +68,13 @@ module LORChess
sum = 0.0 sum = 0.0
row.each { |score| sum += score.to_f } row.each { |score| sum += score.to_f }
@player_score << sum.to_s @player_score << sum.to_s
score_data << [i, sum] score_data << {:position => i, :total => sum}
end end
# Sort players in correspondence with the decrease of place # Sort players in the reverse order to total score
score_data.sort! { |x,y| y[1] <=> x[1] } score_data.sort! { |x,y| y[:total] <=> x[:total] }
score_data.each_with_index { |data,i| @player_place[data[0]] = (i+1).to_s } score_data.each_with_index { |data,i| @player_place[data[:position]] = (i+1).to_s }
end end
def stylize_table def stylize_table