Module:Sandbox/Sameboat/m1: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
 
(57 intermediate revisions by the same user not shown)
Line 2:
local p = {}
 
function p.navbar(frame)
local navbar = require('Module:Navbar').navbar
return navbar('asd')
end
 
p.lengthcheck = function()
local asd = '123456789'
return string.len(asd)
end
 
p.indextable = function()
local result = ''
local t={}
t[#t+1]='odin'.. 1 + 0
t[#t+1]='dva'.. '1 + 1'
t[#t+1]='tri'.. 1.5 * 2
return table.concat(t, ', ') .. '.'
end
local function makeInvokeFunction(funcName)
Line 15 ⟶ 34:
function p._link(args)
local result='{|class="wikitable"\n|-'
local t = {
t.{h='a', d='1a'},
t.{h='b', d='2b'},
t.{h='c', d='3c'},
t.{h='d', d='4d'},
}
for k,v in ipair(t) do
t[5] = {h = 'e', d = '5e'}
result=result..'\n|-\n!'..k..'\n|'..v
t[6] = {h = 'f', d = '6f'}
t[7] = {h = 'g', d = '7g'}
for ki,v in ipairipairs(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|-\n!'..kv..'\n|'..vd
end
result=result..'\n|-'
local t = {
{h='aa', d='1aa'},
{h='bb', d='2bb'},
{h='cc', d='3cc'},
{h='dd', d='4dd'},
}
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|}'