Module:NHVer

local p = {} local getArgs = require('Module:Arguments').getArgs

function p.main(frame) local args     = getArgs(frame) local args1    = args[1] or '' local args2    = args[2] or '' return p.outputNHVer(args1, args2) end

function p.outputNHVer(args1, args2) local function isEmpty(s) return s == nil or s == '' end local function tableEmpty(s) return next(s) == nil end local patches = { ["1.1.1"] = "1.1.0",   	["1.1.2"] = "1.1.0",    	["1.1.3"] = "1.1.0",    	["1.1.4"] = "1.1.0",    	["1.2.1"] = "1.2.0",    	["1.3.1"] = "1.3.0",    	["1.4.1"] = "1.4.0",    	["1.4.2"] = "1.4.0",    	["1.5.1"] = "1.5.0",    	["1.11.1"] = "1.11.0",    	["2.0.1"] = "2.0",    	["2.0.2"] = "2.0",    	["2.0.3"] = "2.0",    	["2.0.4"] = "2.0",    	["2.0.5"] = "2.0",    }    local names = { ["1.0.0"] = "initial release", ["1.1.0"] = "First Update", ["1.1.1"] = "First Update", ["1.1.2"] = "First Update", ["1.1.3"] = "First Update", ["1.1.4"] = "First Update", ["1.2.0"] = "April Free Update", ["1.2.1"] = "April Free Update", ["1.3.0"] = "Free Summer Update (Wave 1)", ["1.3.1"] = "Free Summer Update (Wave 1)", ["1.4.0"] = "Summer Update (Wave 2)", ["1.4.1"] = "Summer Update (Wave 2)", ["1.4.2"] = "Summer Update (Wave 2)", ["1.5.0"] = "Fall Update", ["1.5.1"] = "Fall Update", ["1.6.0"] = "Free Winter Update" }	local print = '' if not isEmpty(args1) then if args1 == "1.0.0" then print = print .. "1.0.0" else if not isEmpty(patches[args1]) then print = print .. "" .. args1 .. "" else print = print .. "" .. args1 .. "" end end -- If args2 has full, then append full name if not isEmpty(args2) then print = print .. " "			if not isEmpty(names[args1]) then print = print .. names[args1] else print = print .. "Free Update" end end end return print end return p