Module:Sprite grid

local p = {} function p.grid( f ) local args = f:getParent.args local rows = {} local sprite = require( 'Module:Sprite' ).sprite for k, v in ipairs( args ) do		local row = {} for v2 in mw.text.gsplit( v:gsub( '\n',  ),  ) do			local name local link = '' if v2 == ' ' then name = 'air' else name = args[v2] or '?' link = name if link == '?' then link = '' end end table.insert( row, sprite{ name, link = link, name = 'Block', sheetsize = 384 } ) end table.insert( rows, table.concat( row, ' || ' ) ) end return '{| cellspacing="0" cellpadding="0" style="line-height:0"\n| ' .. table.concat( rows, '\n|-\n| ' ) .. '\n|}' end return p