Jump to content

Module:PickRow

From p1gwars
Revision as of 20:28, 11 January 2026 by Wouter (talk | contribs)

Documentation for this module may be created at Module:PickRow/doc

local p = {}
local column = 0

function p.pick_row(tab, args)
    if tonumber(args.column) > 0 then
        column = tonumber(args.column)
    end

    for _, row in ipairs(tab.data) do
        if row[column] ~= "Tijgertje I" then
            for c, _ in ipairs(row) do
                if tab.schema.fields[c].type == "number" then
                    row[c] = 0
                end
            end
         end
     end
     return tab
end

return p