Module:Damage: Difference between revisions

From Elwiki
No edit summary
No edit summary
Line 1: Line 1:
local p = {}
local p = {}
local t = {}
p.loop = function(frame)
 
local stage = frame.args.stage
function p.hello( frame )
local rows = {}
  local t = {}
-- the actual looping part
  for name, value in frame:argumentPairs() do
for value in mw.text.gsplit(stage, ',') do
      t[name] = value
table.insert(rows, '|' .. value)
  end
end
return ' {|\n' .. table.concat(rows, '\n|-\n') .. '\n|}'
end
end
return p
return p

Revision as of 00:29, 20 March 2022

Documentation for this module may be created at Module:Damage/doc

local p = {}
p.loop = function(frame)
	local stage = frame.args.stage
	local rows = {}
	-- the actual looping part
	for value in mw.text.gsplit(stage, ',') do
		table.insert(rows, '|' .. value)
	end
	
	return ' {|\n' .. table.concat(rows, '\n|-\n') .. '\n|}'
end
return p