Module:Polygon

-- This module is invoked by Template:Poly local p = {} local getArgs = require('Module:Arguments').getArgs

function p.main(frame) return p._main(getArgs(frame)) end

function p._main(args) local shape = 'poly' local cnt local coord = {} for i = 1, 50 do       if(args[i] ~= nil) then local s = args[i] local offset = string.find(s, ' ') coord[1] = string.sub(s, 0, offset) coord[2] = string.sub(s, offset) shape = shape..' '..tonumber(coord[1])..' '..tonumber(coord[2]) cnt = i + 1 end end if(args[cnt] ~= nil) then shape = shape..' '..args[cnt] end return shape end

return p