Module:Exercises/Game Links 1

local p = {}

function p.Main(frame) return p.main(frame:getParent.args) end

function p.main(args) local game = args[1] -- renamed "msg" to "game" for clarity local fullTitle -- This needs to be declared here due to lexical scoping if game == "The Legend of Zelda" then fullTitle = "The Legend of Zelda (Game)" elseif game == "The Adventure of Link" then fullTitle = "Zelda II: The Adventure of Link" else fullTitle = "The Legend of Zelda: " .. game end local link = "" .. game .. "" -- title would be nil here if we declared it inside the if blocks return "*" .. link end

return p