Module:Sandbox/Sameboat/m1 explained

local getArgs = require('Module:Arguments').getArgs local p =

function p.navbar(frame) local navbar = require('Module:Navbar').navbar return navbar('asd')end

p.lengthcheck = functionlocal asd = '123456789'return string.len(asd)end

p.indextable = functionlocal result = local t=t[#t+1]='odin'.. 1 + 0t[#t+1]='dva'.. '1 + 1't[#t+1]='tri'.. 1.5 * 2return table.concat(t, ', ') .. '.'end local function makeInvokeFunction(funcName) -- makes a function that can be returned from #invoke, using -- . return function (frame) local args = getArgs(frame,) return p[funcName](args) endend p.link = makeInvokeFunction('_link') function p._link(args) local result='

-' local t = t[5] = t[6] = t[7] = for i,v in ipairs(t) do if i

5 then break else result=result..'\n!'..v.h end end result=result..'\n

-' for i,v in ipairs(t) do result=result..'\n'..v.d end result=result..'\n-' local t = for i,v in ipairs(t) do result=result..'\n!'..v.h end result=result..'\n-' for i,v in ipairs(t) do result=result..'\n'..v.d end return result .. '\n
'end p.row = makeInvokeFunction('_row')function p._row(args) local somelist = args[1] local result result = for k1, v1 in ipairs(mw.text.split(somelist, '\n')) do for k2, v2 in ipairs(mw.text.split(v1 .. '\\', '\\')) do if k2 > 2 then break elseif (k2 % 2

1) then if (k1 % 2

0) then result = result .. '\n|-style="background:#888"\n!' .. k1 .. '\n|' .. v2 else result = result .. '\n|-\n!' .. k1 .. '\n|' .. v2 end elseif (k2 % 2

0) then result = result .. '||' .. v2 end end end result = '

' return resultend return p