Jump to content

Module:User:Happy5214/RandomHighwayShield

From Wikipedia, the free encyclopedia
local p = {}

function p.shield(frame)
	local args = frame.args
	local num = args.num or 0
	local state = args[1] or "NH"
	local type = args[2] or "NH"
	math.randomseed(os.time() + tonumber(num))
	local routes = {'4', '10', '45', '75'}
	--[[ local routes = {'1A', '1B', '3A', '4', '4A', '9', '9A', '10', '10A', '11',
	                '11A', '11B', '11C', '11D', '12', '12A', '13', '16', '16A',
	                '16B', '18', '25', '25A', '25B', '25C', '26', '27', '28',
	                '28A', '28 Bypass', '31', '32', '33', '38', '41', '43', '45',
	                '47', '49', '63', '75', '77', '78', '84', '85', '87', '88',
	                '97', '101', '101A', '101E', '102', '103', '103A', '103B',
	                '104', '106', '107', '107A', '108', '109A', '110', '110A',
	                '110B', '111', '111A', '112', '113', '113A', '113B', '114',
	                '114A', '115', '115A', '116', '117', '118', '119', '120',
	                '121', '121A', '122', '123', '123A', '124', '125', '126',
	                '127', '128', '129', '130', '132', '135', '136', '137', '140',
	                '141', '142', '145', '149', '150', '151', '152', '153', '155',
	                '155A', '156', '171', '175', '236', '286'} ]]
	local length = #routes
	local index = math.random(length)
	local route = routes[index]
	local parserModule = require "Module:Road data/parser"
	return parserModule.parser({state = state, type = type, route = route}, "shield")
end

return p