Module:Sandbox

From the Super Mario Wiki, the Mario encyclopedia
Revision as of 10:54, November 17, 2020 by FnControlOption (talk | contribs)
Jump to navigationJump to search

The sandbox (Module:Sandbox) is a module namespace page designed for testing and experimenting with Lua syntax. Feel free to try your skills at programming here: Click on edit, make your changes, then click "Save changes" when you are finished. Code added here will not stay permanently. Feel free to revert the page to its hello world function when you are done using it. This is not a page to chat.

If you need further help with modules, see the Lua reference manual.


local p = {}

function p.hello( frame )
    return "'''Hello, world!'''"
end

function p.pmitem(frame)
	local args = frame.args
	local game = args.game or "PM"
	local item = args[2] or args[1]
	local link = args.link or args[1]
	local text = args.text or item
	local imageSize = args.size
	if imageSize == nil then
		imageSize = "50x50px"
	end
	return string.format("game=%s item=%s link=%s text=%s size=%s", game, item, link, text, imageSize)
end

return p