Module:Games

local p = {}

local games = { ["AR"] = "All Roads", ["FO1"] = "Fallout", ["FO2"] = "Fallout 2", ["FO3"] = "Fallout 3", ["FO3OA"] = "Operation: Anchorage", ["FO3TP"] = "The Pitt", ["FO3BS"] = "Broken Steel", ["FO3PL"] = "Point Lookout", ["FO3MZ"] = "Mothership Zeta", ["FNV"] = "Fallout: New Vegas", ["FNVDM"] = "Dead Money", ["FNVHH"] = "Honest Hearts", ["FNVOWB"] = "Old World Blues", ["FNVLR"] = "Lonesome Roads", ["FO4"] = "Fallout 4", ["FOS"] = "Fallout Shelter", ["FOT"] = "Fallout Tactics", ["FOBOS"] = "Fallout: Brotherhood of Steel" }

function ftrim(str, char) local first = string.sub(str, 1, 1) if first == char then return string.sub(str, 2) else return str end end

function p.links(frame) local result = '' for game in string.gmatch(frame.args[1], '([^,]+)') do       result = result .. '' .. games[ftrim(game, ' ')] .. ' ' end return frame:preprocess(string.sub(result, 1, string.len(result) - 5)) end

return p