Content deleted Content added
save |
save |
||
Line 86:
end
spacer(170)
spacer(args.
end
output:allDone()
Line 92:
local teams = {}
local scores = {}
for k, v in
if
if
if (k - 1) % 5 == 0 then▼
▲ table.insert(details, v)
else▼
insertPairs(scores, v)▼
end▼
else
insertPairs(
end
end
end
local step = 1 --Begin output
local skip = 0
local skip2
local skips = 0
local rows = math.pow(2, args.columns) * 3
local span
local rMod = 0
local rPhase = 0
local rTarg
local cap = 0
for c = 1, --[[]]2 do--]]args.columns do
cap = cap + (rows / math.pow(2, c)) / 3
skip = (rows - rows / math.pow(2, c - 1)) / math.pow(2, args.columns - c + 1)
skips = 0 + skip
if skip > 0 then
last.cell = rowNum[r + (r > 1 and skip % 2 or 0)]:tag('td')
skip2 = r > 1 and r < (rows - skip)
last.cell:attr('rowspan', skip * (skip2 and 2 or 1)+(r == 1 and skip % 2 or 0))
last.cell:css('border', '3px solid')
:css('border-left', '0')
--return r
▲ end
end
r = r + (r == 1 and skip % 2 or 0)
end
end
if rowNum[1] then
--rowNum[1]:tag('td')
-- :attr('rowspan', skip
rowNum[1]:tag('td')
:attr('rowspan', rows)
rowNum[1]:tag('td')
:attr('colspan', 2) :attr('rowspan', skip)
end
▲ for r = skips, rows - skip - c do
for r = 1 + skips - (c - 1) % 2, rows, 2 do
if c == 1 then
newRow(r)
newRow(r + 1)
end
rTarg = r + skips
if rowNum[rTarg]
last.row = rowNum[rTarg]
--[[]if c > 1 and r % (skip * 2) == 0 then
Line 137 ⟶ 160:
end--]]
addCol(rTarg, 2, 2)
rMod = (r -
if
rowNum[rTarg]:tag('td')
:wikitext(details[step])
Line 144 ⟶ 167:
:attr('colspan', 2)
else
if
teamBox(teams[step], 1, rTarg)
teamBox(scores[step], 1, rTarg)
Line 151 ⟶ 174:
teamBox(scores[step], 2, rTarg)
step = step + 1
▲ if (r - 1) % 2 == (c - 1) % 2 then
last.cell = last.row:tag('td')
last.cell:attr('rowspan',
if
last.cell:css('border', '3px solid')
:css('border-left', '0')
:wikitext(c)
end
addCol(rTarg, 1,
end]]
if skip > 0 and rowNum[rTarg + 2] then
for s =
skips = skips + 1
if c == 1 and (rTarg + s) <= rows then
Line 172 ⟶ 195:
:attr('colspan', 2)
addCol(rTarg, 2, skip * 2)
▲ r = r + skip * 2
end
end
end
rPhase = (rPhase + 1) % 3
end
--end
Line 186 ⟶ 209:
end]]
end
--skip =
end
return output
|