function gt_wumpus() --Definitions congestion_city_nodes = {}; congestion_city_edges = {}; visited_nodes = {}; NODE_NUM = 30; EDGE_NUM = 45; WORM_NUM = 3 COP_ODDS = 15; math.randomseed(os.time()); end function random_node() return 1+math.random(NODE_NUM); end function edge_pair(a,b) if not (a == b) then return { {a,b}, {b,a} }; else return edge_pair(random_node(), random_node()); end end function make_edge_list() tbl = {}; for i=1, NODE_NUM do edge = {}; edge = edge_pair(random_node(), random_node()); table.insert(tbl, edge[1]); table.insert(tbl, edge[2]); end return tbl; end gt_wumpus(); --testing make_edge_list A = make_edge_list(); for i,v in ipairs(A) do print("(", v[1], "->", v[2], ")"); end