Jump to content

Module:NSW GNR

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 99of9 (talk | contribs) at 06:00, 1 April 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- For unit tests, see [[Module:GNR reference/testcases]]
local p = {}
digit = {{"??", "JP", "Ma", "an", "uj", "TR", "SX", "KW", "Mn", "It"},
		 {"jL", "Kq", "qw", "IO", "ck", "Yb", "lp", "jt", "Ql", "wG"},
		 {"Wy", "vq", "lM", "wp", "BK", "oe", "Fx", "Xt", "jz", "Zx"},
		 {"rX", "ZT", "Km", "sE", "WA", "qb", "tL", "Ul", "sy", "xO"},
		 {"GH", "JP", "Ma", "an", "uj", "TR", "SX", "KW", "Mn", "It"}}

function p.convert(frame)
	converted = ""
	for i=1,5 do
      converted = converted .. digit[i][1+tonumber(string.sub(frame.args[1],i,i))]
    end
    return converted
end
return p