Module:Sports table/Chess: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 161:
local show_loss = yesno(Args['show_loss'] or 'no')
local show_sb = yesno(Args['show_sb'] or 'no')
local sb_iff_hth = yesno(Args['sb_iff_hth'] or 'no')
local extra_cols = tonumber(Args['extra_cols']) or 0
local disp_fractions = yesno(Args['disp_fractions'] or 'yes')
Line 198 ⟶ 199:
-- Sonneborn-Berger score
if show_sb then
if sb_iff_hth and hth_local == '—' then
local legs = tonumber(Args['legs']) or 1
sb_score = '—'
for jj=1,N_teams do
end
local tj = Args['team' .. jj]
if iisb_score ~== jj0 then
local tjpoints = win_points*Args['win_'..tj] + draw_points*Args['draw_'..tj] + loss_points*Args['loss_'..tj]
local legs = tonumber(Args['legs']) or 1
if ii ~= jj then
for jj=1,N_teams do
local match_str = Args['match_' .. team_code_ii .. '_' .. tj] or ''
local tj = Args['team' .. jj]
for l=1,legs do
local tjpoints = win_points*Args['win_'..tj] + draw_points*Args['draw_'..tj] + loss_points*Args['loss_'..tj]
local gii = mw.ustring.match(match_str, '^%s*([^%+%s]*)%s*%+?')
if giiii =~= '1'jj then
local match_str = Args['match_' .. team_code_ii .. '_' .. tj] or ''
sb_score = sb_score + win_points*tjpoints
elseif giifor l== '½'1,legs thendo
local gii = mw.ustring.match(match_str, '^%s*([^%+%s]*)%s*%+?')
sb_score = sb_score + draw_points*tjpoints
elseif if gii == '01' then
sb_score = sb_score + loss_pointswin_points*tjpoints
elseif gii == '½' then
sb_score = sb_score + win_pointsdraw_points*tjpoints
elseif gii == '0' then
sb_score = sb_score + draw_pointsloss_points*tjpoints
end
match_str = mw.ustring.gsub(match_str, '^%s*([^%+%s]*)%s*%+?', '') or ''
end
match_str = mw.ustring.gsub(match_str, '^%s*([^%+%s]*)%s*%+?', '') or ''
end
end