Module:NIA

local p = {}

p.items = function( f ) local args = f.args or f       if f == mw.getCurrentFrame and args[1] == nil then args = f:getParent.args else f = mw.getCurrentFrame end local text = "" local escaped = string.gsub(args[1], '\\,', '|') for item in mw.text.gsplit(escaped, '%s*,%s*') do               local deescaped = string.gsub(item, '|', ',') text = text .. f:callParserFunction('#icon', {"", item = deescaped, size = 16, mod = args.mod}) end return text end

function shuffle(list) math.randomseed(os.time + math.random(100)) local indices = {} for i = 1, #list do		indices[#indices+1] = i	end local shuffled = {} for i = 1, #list do		local index = math.random(#indices) local value = list[indices[index]] table.remove(indices, index) shuffled[#shuffled+1] = value end return shuffled end

p.rand = function(f) local args = f.args or f	if f == mw.getCurrentFrame and args[1] == nil then args = f:getParent.args else f = mw.getCurrentFrame end if args[1] == "" then return "" end section = {} for item in mw.text.gsplit(args[1], "", "", 1):gsub(" ", ""))) else if string.find(subitem, "%[%[") then table.insert(section, (subitem:gsub(" ·&#32;", ""))) else table.insert(section, "[[" .. subitem:gsub(" ·&#32;", ""))					end				end			end		else			item = item:gsub("-item\">", "", 1):gsub(" ·&#32;", "")			if item ~= "" then				table.insert(section, "" .. item)			end		end	end	return table.concat(shuffle(section), " ·&#32;") end

return p