Module:GameShortened

local p = {}

function p.getGame(arg, default) local S1 = "S" local S2 = "S2" local S3 = "S3" local OE = "OE" local abbrev = { ['S'] = S,       ['S1'] = S,        ['Splatoon'] = S,        ['Splatoon 1'] = S,        ['S2'] = S2, ['Splatoon 2'] = S2, ['S3'] = S3, ['Splatoon 3'] = S3, ['OE'] = OE, ['Octo Expansion'] = OE, }   -- return the abbreviation from the game arg. -- If arg is nil then a default will be used. return abbrev[arg] or default or "S" end

-- main to extract arg from frame function p.main(frame) local args = frame:getParent.args local arg = args['game'] or args[1] local default = args['default'] or args[2] return p.getGame(arg, default) end

return p