Fandom

Fire Emblem Wiki

Module:Polygon

5,308pages on
this wiki
Add New Page
Talk0

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

-- 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 coord = {}
 
    for i = 1, 50 do
        if(args[i] ~= nil) then
            local s = args[i]
            if(string.sub(s, 0, 2) == '[[') then
                shape = shape..' '..s
            else
                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])
            end
        end
    end
 
    return shape
end
 
return p

Also on Fandom

Random Wiki