Module:Sandbox/B2project/WLT: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 13:
if yesno(sort_table_val) then sort_text = 'sortable' end
table.insert(t,'{|class="wikitable '..sort_text..'" style="text-align:center;"\n') -- Open table
-- Whether tiebreaker is needed
local use_tiebr_val = Argsargs['use_tiebr'] or 'no'
local do_tiebr = false
if yesno(use_tiebr_val) then do_tiebr = true end
-- Custom header options
Line 46 ⟶ 51:
-- True if exist, false otherwise
if yesno(use_ratio_val) then do_ratio = true end
-- Whether tiebreaker is needed
local use_tiebr_val = Args['use_tiebr'] or 'no'
local do_tiebr = false
if yesno(use_tiebr_val) then do_tiebr = true end
-- Initialize
Line 68:
tt = p_sub.colhead(tt,32,'<abbr title="Lost">L</abbr>') -- Loss col
tt = p_sub.colhead(tt,32,tie_head_text)
if not do_tiebr then
tt = p_sub.colhead(tt,32,tiebr_head_text) -- tiebr
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' for">'..fa_letter..'F</abbr>') -- For col
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' against">'..fa_letter..'A</abbr>') -- Against col
if not do_ratio then
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_sing..' difference">'..fa_letter..'D</abbr>') -- Difference col
else
tt = p_sub.colhead(tt,36,'<abbr title="'..fa_word_sing..' ratio">'..fa_letter..'R</abbr>') -- Ratio col
end
end
else
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' for">'..fa_letter..'F</abbr>') -- For col
tt = p_sub.colhead(tt,32,'<abbr title="'..fa_word_plur..' against">'..fa_letter..'A</abbr>') -- Against col
Line 112 ⟶ 105:
local ties = tonumber(Args['tie_'..team_code_ii]) or 0
local losses = tonumber(Args['loss_'..team_code_ii]) or 0
if not do_tiebr then
local tiebr = tonumber(Args['tiebr_'..team_cone_ii]) or 0
local gfor = tonumber(Args['gf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
Line 121 ⟶ 113:
local matches = wins + ties + losses
local points = win_points*wins + tie_points*ties + loss_points*losses + s_pts
else
local gfor = tonumber(Args['gf_'..team_code_ii]) or tonumber(Args['pf_'..team_code_ii]) or 0
local gaig = tonumber(Args['ga_'..team_code_ii]) or tonumber(Args['pa_'..team_code_ii]) or 0
local s_pts = tonumber(Args['adjust_points_'..team_code_ii]) or tonumber(Args['startpoints_'..team_code_ii]) or 0
local hth_local = Args['hth_'..team_code_ii] or nil
-- Then calculate some values
local matches = wins + ties + losses
local points = win_points*wins + tie_points*ties + loss_points*losses + s_pts
end
-- Comparison of for against