Slight changes in 'tournament_table.rb'.
This commit is contained in:
parent
b99fcdd160
commit
b9c0da19d1
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user