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 05:55, 1 April 2019 (all 5 digits). 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 = {}
digit1 = {"??", "JP", "Ma", "an", "uj", "TR", "SX", "KW", "Mn", "It"}
digit2 = {"jL", "Kq", "qw", "IO", "ck", "Yb", "lp", "jt", "Ql", "wG"}
digit3 = {"Wy", "vq", "lM", "wp", "BK", "oe", "Fx", "Xt", "jz", "Zx"}
digit4 = {"rX", "ZT", "Km", "sE", "WA", "qb", "tL", "Ul", "sy", "xO"}
digit5 = {"GH", "JP", "Ma", "an", "uj", "TR", "SX", "KW", "Mn", "It"}

function p.convert(frame)
    return digit1[1+tonumber(string.sub(frame.args[1],1,1))] .. digit2[1+tonumber(string.sub(frame.args[1],2,2))] .. digit3[1+tonumber(string.sub(frame.args[1],3,3))] .. digit4[1+tonumber(string.sub(frame.args[1],4,4))] .. digit5[1+tonumber(string.sub(frame.args[1],5,5))]
end
return p