From f582cb862c18423a6a6e18b55aa9c5dd18472e44 Mon Sep 17 00:00:00 2001 From: Valansch Date: Sun, 16 Jul 2017 14:10:10 +0200 Subject: [PATCH] deleted junk and changed maze name --- generate.lua => locale/gen_shape/maze.lua | 0 locale/map_layout/gens_neko.lua | 145 ---------------------- locale/map_layout/perlin_noise.lua | 71 ----------- locale/map_layout/rail_grid.lua | 135 -------------------- locale/map_layout/sample.lua | 26 ---- locale/map_layout/shapes.lua | 44 ------- 6 files changed, 421 deletions(-) rename generate.lua => locale/gen_shape/maze.lua (100%) mode change 100755 => 100644 delete mode 100644 locale/map_layout/gens_neko.lua delete mode 100644 locale/map_layout/perlin_noise.lua delete mode 100644 locale/map_layout/rail_grid.lua delete mode 100644 locale/map_layout/sample.lua delete mode 100644 locale/map_layout/shapes.lua diff --git a/generate.lua b/locale/gen_shape/maze.lua old mode 100755 new mode 100644 similarity index 100% rename from generate.lua rename to locale/gen_shape/maze.lua diff --git a/locale/map_layout/gens_neko.lua b/locale/map_layout/gens_neko.lua deleted file mode 100644 index 94ad12c6..00000000 --- a/locale/map_layout/gens_neko.lua +++ /dev/null @@ -1,145 +0,0 @@ - ---Author Neko Baron - ---Passive data needed -local random_ores = {"iron-ore","coal","copper-ore","stone","uranium-ore"} -local random_dense = {1.15,0.8,1,0.9, 0.5} --ore density reference -local tree_to_place = {"dry-tree","dry-hairy-tree","tree-06","tree-06","tree-01","tree-02","tree-03"} - ---stuff we need to keep handled -function worldgen_init(event) - global.seed_A = math.random(10,100000) - global.seed_B = math.random(10,100000) - - global.worldgen = true -end - -function worldgen_onchunk(event) - if not global.worldgen then worldgen_init(event) end --Just a cheap lazy idea if I want to setup multiple seeds or suck at start. - - local surface = game.surfaces[1] - local tiles = {} - local decoratives = {} - local entities = surface.find_entities(event.area) - for _, entity in pairs(entities) do - if entity.type == "simple-entity" or entity.type == "resource" or entity.type == "tree" then - entity.destroy() - end - end - - local top_left = event.area.left_top --make a more direct reference - - --do it only per chunk, cause cheaper than every square, and who care anyway. - local distance_bonus = 200 + math.sqrt(top_left.x*top_left.x + top_left.y*top_left.y) * 0.2 - - for x = 0, 31, 1 do - for y = 0, 31, 1 do - local pos_x = top_left.x + x - local pos_y = top_left.y + y - local tile = surface.get_tile(pos_x,pos_y) - local tile_to_insert = "grass-medium" - - local wiggle = 50 + perlin:noise((pos_x*0.005),(pos_y*0.005),global.seed_A + 71) * 60 - local terrain_A = perlin:noise((pos_x*0.005),(pos_y*0.005),global.seed_A + 19) * wiggle --For determining where water is - local terrain_sqr = terrain_A * terrain_A --we can use this again to mess with other layers as well - local terrain_D = 10 + perlin:noise((pos_x*0.001),(pos_y*0.001),global.seed_A + 5) * wiggle --terrain layer - - if terrain_sqr < 50 then --Main water areas - --local deep = (terrain_sqr < 20) and true or false - terrain_A = perlin:noise((pos_x*0.01),(pos_y*0.01),global.seed_A + 31) * 90 + (wiggle * -0.2) --we only gen this when we consider placing water - - if terrain_A * terrain_A > 40 then --creates random bridges over the water by overlapping with another noise layer - - tile_to_insert = "water" - --simpler water fix-not perfect but saves changing extra tiles - if x == 0 then table.insert(tiles, {name = tile_to_insert, position = {pos_x-1,pos_y}})end - if x == 31 then table.insert(tiles, {name = tile_to_insert, position = {pos_x+1,pos_y}})end - if y == 0 then table.insert(tiles, {name = tile_to_insert, position = {pos_x,pos_y-1}})end - if y == 31 then table.insert(tiles, {name = tile_to_insert, position = {pos_x,pos_y+1}})end - else - if terrain_D >= 20 then tile_to_insert = "sand" end - end - elseif terrain_sqr > 80 then - wiggle = 100 + perlin:noise((pos_x*0.005),(pos_y*0.005),global.seed_B + 41) * 60 - local terrain_B = perlin:noise((pos_x*0.01),(pos_y*0.01),global.seed_B + 57) * wiggle --ores layer - local terrain_C = perlin:noise((pos_x*0.02),(pos_y*0.02),global.seed_A + 13) * wiggle --tree layer - - if terrain_B > 35 then --we place ores - local a = 5 - - if terrain_B < 76 then a = math.floor(terrain_B*0.75 + terrain_C*0.5) % 4 + 1 end --if its not super high we place normal ores - - local res_amount = distance_bonus + terrain_sqr * 0.1 - res_amount = math.floor(res_amount * random_dense[a]) - - if surface.can_place_entity {name=random_ores[a], position={pos_x,pos_y}} then - surface.create_entity {name=random_ores[a], position={pos_x,pos_y}, amount=res_amount} - end - end - if terrain_D < 20 then - - - if terrain_C < 4 then --we set grass around near forest areas - - tile_to_insert = "grass" - - if terrain_C < -20 and math.random(1,3) == 1 then --dense trees - local treenum = math.random(3,7) - if surface.can_place_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} then - surface.create_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} - end - else - if terrain_C < 0 and math.random(1,7) == 1 then --less dense trees - local treenum = math.random(3,5) - if surface.can_place_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} then - surface.create_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} - end - end - end - end - else - if terrain_D < 30 then - tile_to_insert = "sand" - - if terrain_C < -20 and math.random(1,7) == 1 then --dense trees - local treenum = math.random(1,3) - if surface.can_place_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} then - surface.create_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} - end - elseif terrain_C < 0 and math.random(1,13) == 1 then --less dense trees - local treenum = math.random(1,2) - if surface.can_place_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} then - surface.create_entity {name=tree_to_place[treenum], position={pos_x,pos_y}} - end - end - else - tile_to_insert = "sand-dark" - if terrain_C > 40 and math.random(1,200) == 1 and surface.can_place_entity {name="crude-oil", position={pos_x,pos_y}} then - surface.create_entity {name="crude-oil", position={pos_x,pos_y}, amount = math.random(20000,60000) +distance_bonus* 2000 } - end - end - end - - if math.floor(terrain_D) % 5 == 1 and math.random(1,70) == 1 and surface.can_place_entity {name="stone-rock", position={pos_x,pos_y}} then - surface.create_entity {name="stone-rock", position={pos_x,pos_y}} - end - - else - if terrain_D >= 20 then - if terrain_D < 30 then - tile_to_insert = "sand" - else - tile_to_insert = "sand-dark" - end - end - end - - table.insert(tiles, {name = tile_to_insert, position = {pos_x,pos_y}}) - end - end - - surface.set_tiles(tiles,true) - for _,deco in pairs(decoratives) do - surface.create_decoratives{check_collision=false, decoratives={deco}} - end -end diff --git a/locale/map_layout/perlin_noise.lua b/locale/map_layout/perlin_noise.lua deleted file mode 100644 index 607bf4fd..00000000 --- a/locale/map_layout/perlin_noise.lua +++ /dev/null @@ -1,71 +0,0 @@ --- original code by Ken Perlin: http://mrl.nyu.edu/~perlin/noise/ - -perlin = {} -perlin.p = {} -perlin.permutation = { 151,160,137,91,90,15, - 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, - 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, - 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, - 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, - 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, - 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, - 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, - 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, - 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, - 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, - 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, - 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180 -} -perlin.size = 256 -perlin.gx = {} -perlin.gy = {} -perlin.randMax = 256 - -function perlin:load( ) - for i=1,self.size do - self.p[i] = self.permutation[i] - self.p[256+i] = self.p[i] - end -end - -function perlin:noise( x, y, z ) - local X = math.floor(x) % 256 - local Y = math.floor(y) % 256 - local Z = math.floor(z) % 256 - x = x - math.floor(x) - y = y - math.floor(y) - z = z - math.floor(z) - local u = fade(x) - local v = fade(y) - local w = fade(z) - local A = self.p[X+1]+Y - local AA = self.p[A+1]+Z - local AB = self.p[A+2]+Z - local B = self.p[X+2]+Y - local BA = self.p[B+1]+Z - local BB = self.p[B+2]+Z - - return lerp(w, lerp(v, lerp(u, grad(self.p[AA+1], x , y , z ), - grad(self.p[BA+1], x-1, y , z )), - lerp(u, grad(self.p[AB+1], x , y-1, z ), - grad(self.p[BB+1], x-1, y-1, z ))), - lerp(v, lerp(u, grad(self.p[AB+2], x , y , z-1), - grad(self.p[BA+2], x-1, y , z-1)), - lerp(u, grad(self.p[AB+2], x , y-1, z-1), - grad(self.p[BB+2], x-1, y-1, z-1)))) -end - -function fade( t ) - return t * t * t * (t * (t * 6 - 15) + 10) -end - -function lerp( t, a, b ) - return a + t * (b - a) -end - -function grad( hash, x, y, z ) - local h = hash % 16 - local u = h < 8 and x or y - local v = h < 4 and y or ((h == 12 or h == 14) and x or z) - return ((h % 2) == 0 and u or -u) + ((h % 3) == 0 and v or -v) -end \ No newline at end of file diff --git a/locale/map_layout/rail_grid.lua b/locale/map_layout/rail_grid.lua deleted file mode 100644 index f6b5b54f..00000000 --- a/locale/map_layout/rail_grid.lua +++ /dev/null @@ -1,135 +0,0 @@ -mymodule = {} - -local function rot_pos(pos, rot) - local ctr = {x = 15, y = 15} - return { - x = ctr.x + (pos.x - ctr.x) * rot.x - (pos.y - ctr.y) * rot.y, - y = ctr.y + (pos.x - ctr.x) * rot.y + (pos.y - ctr.y) * rot.x - } -end - -local function rot_dir(dir, rot) - local cnt = 2 * math.atan2(rot.y, rot.x) / math.pi - return (dir + 2 * cnt) % 8 -end - -local rail_grid = { - ["allway"] = {{["name"] = "curved-rail", ["position"] = {["x"] = 10, ["y"] = 4}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 1}, ["direction"] = 0}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 12.5, ["y"] = 0.5}, ["direction"] = 4}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 17.5, ["y"] = 0.5}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 1}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 4}, ["direction"] = 4}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 3}, ["direction"] = 0}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 15, ["y"] = 3}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 6}, ["direction"] = 4}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 3}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 12, ["y"] = 6}, ["direction"] = 6}, {["name"] = "curved-rail", ["position"] = {["x"] = 12, ["y"] = 8}, ["direction"] = 4}, {["name"] = "curved-rail", ["position"] = {["x"] = 18, ["y"] = 8}, ["direction"] = 5}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 6}, ["direction"] = 3}, {["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 10}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 6, ["y"] = 10}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 6, ["y"] = 10}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 7}, ["direction"] = 3}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 15.5, ["y"] = 6.5}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 7}, ["direction"] = 5}, {["name"] = "curved-rail", ["position"] = {["x"] = 26, ["y"] = 10}, ["direction"] = 7}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 15.5, ["y"] = 9.5}, ["direction"] = 1}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 14.5, ["y"] = 9.5}, ["direction"] = 3}, {["name"] = "curved-rail", ["position"] = {["x"] = 24, ["y"] = 12}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 11}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 8, ["y"] = 12}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 13}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 11}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 13}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 11}, ["direction"] = 3}, {["name"] = "curved-rail", ["position"] = {["x"] = 22, ["y"] = 12}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 29, ["y"] = 11}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 0.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 15}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 15}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 13}, ["direction"] = 3}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 12.5, ["y"] = 12.5}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 13}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 15}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 15}, ["direction"] = 1}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 17.5, ["y"] = 12.5}, ["direction"] = 3}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 29.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 3, ["y"] = 15}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 8, ["y"] = 18}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 6, ["y"] = 18}, ["direction"] = 4}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 6.5, ["y"] = 14.5}, ["direction"] = 4}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 9.5, ["y"] = 15.5}, ["direction"] = 1}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 9.5, ["y"] = 14.5}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 15}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 15}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 17}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 17}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 15}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 15}, ["direction"] = 3}, {["name"] = "curved-rail", ["position"] = {["x"] = 22, ["y"] = 18}, ["direction"] = 7}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 20.5, ["y"] = 15.5}, ["direction"] = 3}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 20.5, ["y"] = 14.5}, ["direction"] = 5}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 23.5, ["y"] = 15.5}, ["direction"] = 0}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 27, ["y"] = 15}, ["direction"] = 0}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 0.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 19}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 17}, ["direction"] = 5}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 12.5, ["y"] = 17.5}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 19}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 17}, ["direction"] = 3}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 17.5, ["y"] = 17.5}, ["direction"] = 5}, {["name"] = "curved-rail", ["position"] = {["x"] = 24, ["y"] = 20}, ["direction"] = 5}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 29.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 20}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 19}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 12, ["y"] = 22}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 18, ["y"] = 22}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 24, ["y"] = 20}, ["direction"] = 6}, {["name"] = "curved-rail", ["position"] = {["x"] = 26, ["y"] = 20}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 29, ["y"] = 19}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 10, ["y"] = 24}, ["direction"] = 7}, {["name"] = "curved-rail", ["position"] = {["x"] = 10, ["y"] = 24}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 23}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 18, ["y"] = 24}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 15.5, ["y"] = 20.5}, ["direction"] = 7}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 14.5, ["y"] = 20.5}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 23}, ["direction"] = 7}, {["name"] = "curved-rail", ["position"] = {["x"] = 10, ["y"] = 26}, ["direction"] = 0}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 14.5, ["y"] = 23.5}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 26}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 27}, ["direction"] = 0}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 15, ["y"] = 27}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 27}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 29}, ["direction"] = 0}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 12.5, ["y"] = 29.5}, ["direction"] = 4}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 17.5, ["y"] = 29.5}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 29}, ["direction"] = 0}}, - ["tshape"] = {{["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 12}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 5, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 21, ["y"] = 11}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 26, ["y"] = 12}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 25, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 29, ["y"] = 11}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 0.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 7.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 15}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 15}, ["direction"] = 7}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 22.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 29.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 3, ["y"] = 15}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 15}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 17}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 21, ["y"] = 17}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 21, ["y"] = 15}, ["direction"] = 3}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 27, ["y"] = 15}, ["direction"] = 0}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 0.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 7.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 8.5, ["y"] = 17.5}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 17}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 19}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 19}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 17}, ["direction"] = 3}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 21.5, ["y"] = 17.5}, ["direction"] = 5}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 22.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 29.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 19}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 20}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 5, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 19}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 21}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 21}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 19}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 21, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 19}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 26, ["y"] = 20}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 25, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 29, ["y"] = 19}, ["direction"] = 2}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 7.5, ["y"] = 20.5}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 23}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 21}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 23}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 23}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 21}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 23}, ["direction"] = 7}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 22.5, ["y"] = 20.5}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 10, ["y"] = 26}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 12, ["y"] = 26}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 18, ["y"] = 26}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 26}, ["direction"] = 1}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 15.5, ["y"] = 24.5}, ["direction"] = 7}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 14.5, ["y"] = 24.5}, ["direction"] = 5}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 15, ["y"] = 27}, ["direction"] = 0}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 12.5, ["y"] = 29.5}, ["direction"] = 4}, {["name"] = "rail-chain-signal", ["position"] = {["x"] = 17.5, ["y"] = 29.5}, ["direction"] = 0}}, - ["straight"] = {{["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 5, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 21, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 25, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 29, ["y"] = 11}, ["direction"] = 2}, {["name"] = "rail-signal", ["position"] = {["x"] = 1.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 3, ["y"] = 15}, ["direction"] = 0}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 27, ["y"] = 15}, ["direction"] = 0}, {["name"] = "rail-signal", ["position"] = {["x"] = 28.5, ["y"] = 17.5}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 5, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 17, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 21, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 25, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 19}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 29, ["y"] = 19}, ["direction"] = 2}}, - ["corner"] = {{["name"] = "straight-rail", ["position"] = {["x"] = 1, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 3, ["y"] = 11}, ["direction"] = 2}, {["name"] = "curved-rail", ["position"] = {["x"] = 8, ["y"] = 12}, ["direction"] = 3}, {["name"] = "rail-signal", ["position"] = {["x"] = 1.5, ["y"] = 12.5}, ["direction"] = 6}, {["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 15}, ["direction"] = 1}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 3, ["y"] = 15}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 15}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 13, ["y"] = 17}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 17}, ["direction"] = 5}, {["name"] = "straight-rail", ["position"] = {["x"] = 15, ["y"] = 19}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 20}, ["direction"] = 3}, {["name"] = "curved-rail", ["position"] = {["x"] = 18, ["y"] = 22}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 23}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 10, ["y"] = 26}, ["direction"] = 0}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 15, ["y"] = 27}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 27}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 29}, ["direction"] = 0}}, - ["ushape"] = {{["name"] = "curved-rail", ["position"] = {["x"] = 12, ["y"] = 4}, ["direction"] = 6}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 4}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 7}, ["direction"] = 7}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 7}, ["direction"] = 1}, {["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 10}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 7}, ["direction"] = 3}, {["name"] = "curved-rail", ["position"] = {["x"] = 26, ["y"] = 10}, ["direction"] = 0}, {["name"] = "rail-signal", ["position"] = {["x"] = 7.5, ["y"] = 9.5}, ["direction"] = 5}, {["name"] = "big-electric-pole", ["position"] = {["x"] = 3, ["y"] = 15}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 27, ["y"] = 15}, ["direction"] = 0}, {["name"] = "curved-rail", ["position"] = {["x"] = 26, ["y"] = 20}, ["direction"] = 5}, {["name"] = "curved-rail", ["position"] = {["x"] = 4, ["y"] = 20}, ["direction"] = 3}, {["name"] = "straight-rail", ["position"] = {["x"] = 7, ["y"] = 23}, ["direction"] = 1}, {["name"] = "straight-rail", ["position"] = {["x"] = 9, ["y"] = 23}, ["direction"] = 5}, {["name"] = "curved-rail", ["position"] = {["x"] = 12, ["y"] = 26}, ["direction"] = 7}, {["name"] = "curved-rail", ["position"] = {["x"] = 20, ["y"] = 26}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 23, ["y"] = 23}, ["direction"] = 3}} -} - -local paddings = { - [2] = {{["name"] = "straight-rail", ["position"] = {["x"] = 31, ["y"] = 11}, ["direction"] = 2}, {["name"] = "straight-rail", ["position"] = {["x"] = 31, ["y"] = 19}, ["direction"] = 2}}, - [4] = {{["name"] = "straight-rail", ["position"] = {["x"] = 11, ["y"] = 31}, ["direction"] = 0}, {["name"] = "straight-rail", ["position"] = {["x"] = 19, ["y"] = 31}, ["direction"] = 0}} -} - -local bitmap = {[18] = {[-29] = 1, [-38] = 1, [-43] = 1, [41] = 1, [32] = 1, [27] = 1, [-4] = 1, [18] = 1, [-9] = 1, [13] = 1, [-18] = 1, [-37] = 1, [-51] = 1, [38] = 1, [33] = 1, [24] = 1, [-3] = 1, [-12] = 1, [-17] = 1, [-26] = 1, [-40] = 1, [-45] = 1, [39] = 1, [30] = 1, [-6] = 1, [-20] = 1, [2] = 1, [-25] = 1, [-34] = 1, [-39] = 1, [-48] = 1, [36] = 1, [31] = 1, [-5] = 1, [-14] = 1, [-19] = 1, [3] = 1, [-28] = 1, [-33] = 1, [-42] = 1, [42] = 1, [37] = 1, [28] = 1, [-8] = 1, [14] = 1, [-13] = 1, [9] = 1, [0] = 1, [-27] = 1, [-36] = 1, [-41] = 1, [-50] = 1, [34] = 1, [29] = 1, [-7] = 1, [15] = 1, [-16] = 1, [6] = 1, [-21] = 1, [1] = 1, [-30] = 1, [-35] = 1, [-44] = 1, [-49] = 1, [40] = 1, [35] = 1, [21] = 1, [12] = 1, [-15] = 1, [-24] = 1}, [32] = {[-18] = 1, [-24] = 1, [-12] = 1, [30] = 1, [24] = 1, [-9] = 1, [3] = 1, [-6] = 1, [-15] = 1, [33] = 1}, [-21] = {[-30] = 1, [-37] = 1, [-48] = 1, [50] = 1, [43] = 1, [32] = 1, [30] = 1, [23] = 1, [-7] = 1, [12] = 1, [-1] = 1, [-2] = 1, [5] = 1, [-9] = 1, [-27] = 1, [-38] = 1, [-45] = 1, [42] = 1, [35] = 1, [24] = 1, [17] = 1, [22] = 1, [-8] = 1, [15] = 1, [-15] = 1, [4] = 1, [-35] = 1, [45] = 1, [34] = 1, [27] = 1, [16] = 1, [9] = 1, [-18] = 1, [-36] = 1, [-43] = 1, [44] = 1, [37] = 1, [-6] = 1, [1] = 1, [-13] = 1, [6] = 1, [-24] = 1, [-33] = 1, [-44] = 1, [49] = 1, [47] = 1, [36] = 1, [29] = 1, [18] = 1, [-3] = 1, [0] = 1, [-14] = 1, [-21] = 1, [-39] = 1, [-34] = 1, [-41] = 1, [48] = 1, [41] = 1, [46] = 1, [39] = 1, [28] = 1, [21] = 1, [3] = 1, [-40] = 1, [-42] = 1, [51] = 1, [40] = 1, [33] = 1, [38] = 1, [31] = 1, [2] = 1, [-12] = 1}, [-4] = {[-36] = 1, [-45] = 1, [-9] = 1, [27] = 1, [18] = 1, [-21] = 1, [-30] = 1, [-33] = 1, [-15] = 1, [21] = 1, [-18] = 1, [0] = 1, [45] = 1, [24] = 1, [-24] = 1, [12] = 1}, [21] = {[28] = 1, [-43] = 1, [-32] = 1, [-23] = 1, [7] = 1, [-14] = 1, [0] = 1, [-5] = 1, [9] = 1, [18] = 1, [27] = 1, [36] = 1, [-44] = 1, [-17] = 1, [-24] = 1, [6] = 1, [-15] = 1, [15] = 1, [-6] = 1, [8] = 1, [17] = 1, [35] = 1, [-45] = 1, [-36] = 1, [-27] = 1, [-18] = 1, [-9] = 1, [5] = 1, [-16] = 1, [14] = 1, [-7] = 1, [16] = 1, [34] = 1, [-28] = 1, [-19] = 1, [-10] = 1, [4] = 1, [13] = 1, [-8] = 1, [31] = 1, [24] = 1, [33] = 1, [42] = 1, [-49] = 1, [-29] = 1, [-20] = 1, [-11] = 1, [3] = 1, [12] = 1, [21] = 1, [30] = 1, [39] = 1, [32] = 1, [41] = 1, [-50] = 1, [-48] = 1, [-39] = 1, [-30] = 1, [-21] = 1, [-12] = 1, [-3] = 1, [29] = 1, [40] = 1, [-51] = 1, [-42] = 1, [-33] = 1, [-31] = 1, [-22] = 1, [-13] = 1, [-4] = 1}, [-43] = {[-3] = 1, [6] = 1, [-24] = 1, [33] = 1, [-15] = 1, [3] = 1, [12] = 1, [-9] = 1, [9] = 1, [18] = 1}, [-24] = {[-33] = 1, [12] = 1, [-3] = 1, [42] = 1, [-28] = 1, [17] = 1, [-21] = 1, [24] = 1, [-39] = 1, [6] = 1, [-16] = 1, [-9] = 1, [36] = 1, [43] = 1, [-27] = 1, [18] = 1, [-20] = 1, [25] = 1, [0] = 1, [7] = 1, [48] = 1, [-15] = 1, [44] = 1, [-19] = 1, [26] = 1, [8] = 1, [15] = 1, [49] = 1, [-32] = 1, [45] = 1, [-18] = 1, [27] = 1, [-36] = 1, [9] = 1, [50] = 1, [-6] = 1, [39] = 1, [-31] = 1, [46] = 1, [-24] = 1, [21] = 1, [-17] = 1, [-42] = 1, [3] = 1, [-35] = 1, [10] = 1, [51] = 1, [-12] = 1, [33] = 1, [40] = 1, [-30] = 1, [47] = 1, [-23] = 1, [22] = 1, [-34] = 1, [11] = 1, [41] = 1, [-29] = 1, [16] = 1, [-22] = 1, [23] = 1, [30] = 1}, [-6] = {[34] = 1, [45] = 1, [52] = 1, [-49] = 1, [-42] = 1, [-47] = 1, [-40] = 1, [4] = 1, [-29] = 1, [15] = 1, [-11] = 1, [-4] = 1, [24] = 1, [35] = 1, [42] = 1, [53] = 1, [-52] = 1, [-41] = 1, [-34] = 1, [-39] = 1, [5] = 1, [-32] = 1, [12] = 1, [-21] = 1, [30] = 1, [-3] = 1, [32] = 1, [50] = 1, [-51] = 1, [-33] = 1, [2] = 1, [-31] = 1, [13] = 1, [-24] = 1, [31] = 1, [-6] = 1, [38] = 1, [33] = 1, [40] = 1, [51] = 1, [-54] = 1, [-36] = 1, [3] = 1, [-18] = 1, [21] = 1, [28] = 1, [-5] = 1, [39] = 1, [46] = 1, [41] = 1, [48] = 1, [-53] = 1, [-46] = 1, [-35] = 1, [-28] = 1, [0] = 1, [-10] = 1, [18] = 1, [-15] = 1, [29] = 1, [36] = 1, [47] = 1, [54] = 1, [49] = 1, [-45] = 1, [-38] = 1, [6] = 1, [-27] = 1, [1] = 1, [8] = 1, [-9] = 1, [-1] = 1, [-2] = 1, [37] = 1, [-50] = 1, [-48] = 1, [-37] = 1, [7] = 1, [-30] = 1, [14] = 1, [9] = 1, [-12] = 1, [27] = 1}, [46] = {[12] = 1, [3] = 1, [-9] = 1, [18] = 1, [21] = 1, [6] = 1, [9] = 1, [-6] = 1, [24] = 1}, [-3] = {[55] = 1, [48] = 1, [-52] = 1, [0] = 1, [25] = 1, [18] = 1, [43] = 1, [-48] = 1, [36] = 1, [-23] = 1, [-30] = 1, [54] = 1, [-12] = 1, [6] = 1, [-53] = 1, [31] = 1, [24] = 1, [-42] = 1, [42] = 1, [-17] = 1, [35] = 1, [-24] = 1, [53] = 1, [-6] = 1, [-13] = 1, [-29] = 1, [12] = 1, [-54] = 1, [30] = 1, [23] = 1, [-36] = 1, [41] = 1, [-18] = 1, [34] = 1, [-25] = 1, [52] = 1, [-14] = 1, [-55] = 1, [29] = 1, [22] = 1, [-37] = 1, [47] = 1, [40] = 1, [-19] = 1, [33] = 1, [-26] = 1, [51] = 1, [-15] = 1, [-49] = 1, [3] = 1, [-56] = 1, [28] = 1, [21] = 1, [-38] = 1, [46] = 1, [-45] = 1, [39] = 1, [-20] = 1, [32] = 1, [-27] = 1, [57] = 1, [-2] = 1, [-1] = 1, [50] = 1, [-9] = 1, [-16] = 1, [9] = 1, [-50] = 1, [-57] = 1, [27] = 1, [-39] = 1, [45] = 1, [-46] = 1, [38] = 1, [-21] = 1, [-28] = 1, [56] = 1, [-3] = 1, [49] = 1, [15] = 1, [-51] = 1, [26] = 1, [-33] = 1, [44] = 1, [-47] = 1, [37] = 1, [-22] = 1}, [17] = {[-6] = 1, [-12] = 1, [-33] = 1, [-48] = 1, [36] = 1, [0] = 1, [27] = 1, [21] = 1, [33] = 1, [6] = 1, [-24] = 1, [18] = 1, [12] = 1, [-39] = 1, [24] = 1, [9] = 1}, [-30] = {[27] = 1, [18] = 1, [45] = 1, [36] = 1, [-33] = 1, [-42] = 1, [-24] = 1, [-6] = 1, [-11] = 1, [15] = 1, [6] = 1, [24] = 1, [19] = 1, [42] = 1, [-36] = 1, [-41] = 1, [-18] = 1, [-23] = 1, [-32] = 1, [12] = 1, [7] = 1, [30] = 1, [16] = 1, [43] = 1, [34] = 1, [-26] = 1, [-31] = 1, [22] = 1, [17] = 1, [35] = 1, [-25] = 1, [23] = 1, [-10] = 1, [-15] = 1, [20] = 1, [33] = 1, [-40] = 1, [-22] = 1, [-27] = 1, [-9] = 1, [8] = 1, [3] = 1, [21] = 1, [44] = 1, [39] = 1, [-39] = 1, [-21] = 1, [-30] = 1, [-3] = 1, [-12] = 1, [9] = 1, [0] = 1}, [30] = {[-25] = 1, [-18] = 1, [20] = 1, [6] = 1, [9] = 1, [-13] = 1, [-6] = 1, [-3] = 1, [-17] = 1, [18] = 1, [21] = 1, [7] = 1, [14] = 1, [-16] = 1, [-30] = 1, [-27] = 1, [-20] = 1, [33] = 1, [19] = 1, [4] = 1, [15] = 1, [-15] = 1, [-8] = 1, [-19] = 1, [-33] = 1, [27] = 1, [5] = 1, [12] = 1, [-10] = 1, [-7] = 1, [-32] = 1, [-21] = 1, [-36] = 1, [24] = 1, [3] = 1, [13] = 1, [-9] = 1, [-1] = 1, [-2] = 1, [-31] = 1, [-24] = 1, [36] = 1, [0] = 1, [-12] = 1, [-26] = 1, [30] = 1, [8] = 1, [-14] = 1, [-11] = 1}, [9] = {[0] = 1, [9] = 1, [-42] = 1, [-33] = 1, [-14] = 1, [-27] = 1, [-18] = 1, [21] = 1, [30] = 1, [-34] = 1, [36] = 1, [-57] = 1, [45] = 1, [-15] = 1, [-6] = 1, [-29] = 1, [-28] = 1, [-19] = 1, [29] = 1, [6] = 1, [15] = 1, [48] = 1, [-45] = 1, [-35] = 1, [-16] = 1, [-7] = 1, [-30] = 1, [-21] = 1, [-20] = 1, [18] = 1, [27] = 1, [28] = 1, [5] = 1, [-46] = 1, [33] = 1, [-36] = 1, [42] = 1, [-9] = 1, [-8] = 1, [26] = 1, [3] = 1, [4] = 1, [-47] = 1, [-10] = 1, [25] = 1, [2] = 1, [11] = 1, [12] = 1, [-48] = 1, [-39] = 1, [39] = 1, [-11] = 1, [-1] = 1, [-2] = 1, [-24] = 1, [23] = 1, [24] = 1, [1] = 1, [10] = 1, [51] = 1, [-54] = 1, [-13] = 1, [-12] = 1, [-3] = 1, [-17] = 1, [22] = 1}, [-9] = {[-1] = 1, [-2] = 1, [-9] = 1, [40] = 1, [33] = 1, [-37] = 1, [-48] = 1, [12] = 1, [5] = 1, [27] = 1, [16] = 1, [-21] = 1, [-7] = 1, [-49] = 1, [-35] = 1, [32] = 1, [-38] = 1, [-45] = 1, [54] = 1, [15] = 1, [4] = 1, [29] = 1, [26] = 1, [-19] = 1, [-8] = 1, [-15] = 1, [-50] = 1, [45] = 1, [42] = 1, [-36] = 1, [7] = 1, [28] = 1, [21] = 1, [18] = 1, [-20] = 1, [-27] = 1, [-30] = 1, [-5] = 1, [37] = 1, [-33] = 1, [48] = 1, [9] = 1, [6] = 1, [31] = 1, [-3] = 1, [-6] = 1, [-13] = 1, [36] = 1, [-34] = 1, [-41] = 1, [51] = 1, [8] = 1, [30] = 1, [-18] = 1, [-4] = 1, [-14] = 1, [39] = 1, [-39] = 1, [-42] = 1, [11] = 1, [0] = 1, [25] = 1, [-12] = 1, [-51] = 1, [41] = 1, [38] = 1, [-40] = 1, [10] = 1, [3] = 1, [24] = 1, [17] = 1, [-24] = 1}, [19] = {[-48] = 1, [-39] = 1, [0] = 1, [-3] = 1, [3] = 1, [39] = 1, [24] = 1, [-36] = 1, [-27] = 1, [27] = 1, [-42] = 1, [21] = 1}, [-34] = {[-12] = 1, [-18] = 1, [-6] = 1, [-3] = 1, [-27] = 1, [3] = 1, [36] = 1, [0] = 1, [-21] = 1, [30] = 1, [-9] = 1}, [15] = {[30] = 1, [-43] = 1, [-46] = 1, [33] = 1, [-27] = 1, [-30] = 1, [-21] = 1, [-7] = 1, [16] = 1, [-49] = 1, [-44] = 1, [-35] = 1, [-28] = 1, [13] = 1, [-8] = 1, [-50] = 1, [24] = 1, [-41] = 1, [-36] = 1, [-25] = 1, [-11] = 1, [12] = 1, [21] = 1, [18] = 1, [27] = 1, [-42] = 1, [-33] = 1, [37] = 1, [43] = 1, [-26] = 1, [-12] = 1, [-3] = 1, [6] = 1, [-6] = 1, [15] = 1, [29] = 1, [-47] = 1, [-34] = 1, [36] = 1, [45] = 1, [-31] = 1, [42] = 1, [-18] = 1, [-9] = 1, [14] = 1, [28] = 1, [-48] = 1, [-39] = 1, [39] = 1, [44] = 1, [-32] = 1, [-10] = 1, [0] = 1, [9] = 1, [-51] = 1, [-45] = 1, [-40] = 1, [38] = 1, [-29] = 1, [-24] = 1, [-15] = 1, [3] = 1, [17] = 1}, [51] = {[-5] = 1, [0] = 1, [9] = 1, [14] = 1, [-11] = 1, [-6] = 1, [3] = 1, [8] = 1, [-12] = 1, [-3] = 1, [11] = 1, [-9] = 1, [-4] = 1, [5] = 1, [10] = 1, [-15] = 1, [-10] = 1, [4] = 1, [13] = 1, [18] = 1, [-7] = 1, [7] = 1, [12] = 1, [21] = 1, [-13] = 1, [-8] = 1, [6] = 1, [15] = 1, [-14] = 1}, [-51] = {[5] = 1, [-9] = 1, [11] = 1, [4] = 1, [-3] = 1, [10] = 1, [3] = 1, [-18] = 1, [9] = 1, [-12] = 1, [-6] = 1, [-7] = 1, [6] = 1, [-8] = 1, [-15] = 1, [12] = 1}, [48] = {[-10] = 1, [21] = 1, [12] = 1, [3] = 1, [-9] = 1, [24] = 1, [13] = 1, [-6] = 1, [14] = 1, [15] = 1, [6] = 1, [18] = 1, [9] = 1, [0] = 1, [-3] = 1, [-12] = 1, [1] = 1, [-1] = 1, [-2] = 1, [-11] = 1, [2] = 1}, [39] = {[-4] = 1, [-11] = 1, [-21] = 1, [24] = 1, [17] = 1, [14] = 1, [-12] = 1, [-29] = 1, [16] = 1, [9] = 1, [6] = 1, [-1] = 1, [-2] = 1, [-9] = 1, [-27] = 1, [-30] = 1, [19] = 1, [-7] = 1, [-10] = 1, [-17] = 1, [-28] = 1, [21] = 1, [18] = 1, [11] = 1, [0] = 1, [-8] = 1, [-15] = 1, [-18] = 1, [-25] = 1, [20] = 1, [13] = 1, [10] = 1, [3] = 1, [-5] = 1, [-16] = 1, [-26] = 1, [12] = 1, [-3] = 1, [-6] = 1, [-24] = 1, [15] = 1}, [36] = {[-31] = 1, [-24] = 1, [18] = 1, [0] = 1, [15] = 1, [-30] = 1, [20] = 1, [19] = 1, [8] = 1, [-3] = 1, [-28] = 1, [-29] = 1, [21] = 1, [28] = 1, [27] = 1, [9] = 1, [-9] = 1, [-27] = 1, [-20] = 1, [-21] = 1, [22] = 1, [29] = 1, [3] = 1, [10] = 1, [-16] = 1, [-19] = 1, [23] = 1, [30] = 1, [12] = 1, [11] = 1, [-15] = 1, [-8] = 1, [-18] = 1, [6] = 1, [-7] = 1, [-32] = 1, [-17] = 1, [24] = 1, [-33] = 1, [7] = 1, [-12] = 1, [-6] = 1}, [-11] = {[15] = 1, [-21] = 1, [51] = 1, [-33] = 1, [3] = 1, [12] = 1, [30] = 1, [-24] = 1, [-6] = 1, [-18] = 1, [36] = 1, [45] = 1, [-45] = 1, [-36] = 1, [0] = 1, [9] = 1, [27] = 1, [6] = 1}, [11] = {[-15] = 1, [21] = 1, [3] = 1, [-33] = 1, [36] = 1, [-18] = 1, [-39] = 1, [-6] = 1, [-24] = 1, [12] = 1, [51] = 1, [33] = 1, [-3] = 1, [-21] = 1, [15] = 1, [-48] = 1, [9] = 1, [42] = 1, [45] = 1, [-27] = 1, [0] = 1}, [-18] = {[38] = 1, [41] = 1, [-43] = 1, [-36] = 1, [0] = 1, [-18] = 1, [-15] = 1, [18] = 1, [-8] = 1, [21] = 1, [28] = 1, [39] = 1, [-45] = 1, [-38] = 1, [-17] = 1, [8] = 1, [19] = 1, [-7] = 1, [26] = 1, [29] = 1, [36] = 1, [-48] = 1, [-37] = 1, [-30] = 1, [-27] = 1, [6] = 1, [9] = 1, [-9] = 1, [16] = 1, [27] = 1, [34] = 1, [37] = 1, [-22] = 1, [7] = 1, [-12] = 1, [17] = 1, [24] = 1, [35] = 1, [42] = 1, [45] = 1, [-42] = 1, [-39] = 1, [-32] = 1, [-21] = 1, [15] = 1, [22] = 1, [25] = 1, [-31] = 1, [-24] = 1, [12] = 1, [-6] = 1, [23] = 1, [-3] = 1, [30] = 1, [33] = 1, [40] = 1, [-44] = 1, [-33] = 1, [3] = 1, [-23] = 1, [-16] = 1, [20] = 1}, [-45] = {[0] = 1, [9] = 1, [14] = 1, [3] = 1, [36] = 1, [-11] = 1, [-6] = 1, [2] = 1, [-17] = 1, [-12] = 1, [-3] = 1, [19] = 1, [33] = 1, [-18] = 1, [-9] = 1, [13] = 1, [18] = 1, [-24] = 1, [-15] = 1, [-10] = 1, [12] = 1, [21] = 1, [35] = 1, [-21] = 1, [-16] = 1, [-7] = 1, [1] = 1, [6] = 1, [15] = 1, [20] = 1, [34] = 1, [-8] = 1}, [-7] = {[-24] = 1, [-45] = 1, [48] = 1, [0] = 1, [-27] = 1, [36] = 1, [45] = 1, [54] = 1, [15] = 1, [-48] = 1, [-30] = 1, [-21] = 1, [24] = 1, [-12] = 1, [3] = 1, [-33] = 1, [21] = 1}, [-42] = {[31] = 1, [32] = 1, [-20] = 1, [-15] = 1, [33] = 1, [-19] = 1, [8] = 1, [3] = 1, [20] = 1, [-21] = 1, [-27] = 1, [-9] = 1, [9] = 1, [0] = 1, [18] = 1, [21] = 1, [-24] = 1, [-6] = 1, [-3] = 1, [-12] = 1, [14] = 1, [19] = 1, [36] = 1, [15] = 1, [6] = 1, [34] = 1, [-18] = 1, [-8] = 1, [12] = 1, [7] = 1, [30] = 1, [35] = 1, [-7] = 1, [13] = 1}, [-46] = {[-21] = 1, [-9] = 1, [-3] = 1, [-12] = 1, [9] = 1, [-6] = 1, [12] = 1, [18] = 1}, [3] = {[-50] = 1, [11] = 1, [-16] = 1, [-7] = 1, [50] = 1, [-20] = 1, [41] = 1, [-43] = 1, [46] = 1, [-38] = 1, [28] = 1, [5] = 1, [10] = 1, [-13] = 1, [-8] = 1, [53] = 1, [35] = 1, [-17] = 1, [40] = 1, [-44] = 1, [-35] = 1, [4] = 1, [-14] = 1, [-5] = 1, [52] = 1, [34] = 1, [-18] = 1, [43] = 1, [-41] = 1, [-36] = 1, [-59] = 1, [30] = 1, [-54] = 1, [7] = 1, [12] = 1, [-6] = 1, [-24] = 1, [37] = 1, [-47] = 1, [42] = 1, [-42] = 1, [19] = 1, [-33] = 1, [24] = 1, [-60] = 1, [-51] = 1, [6] = 1, [15] = 1, [-12] = 1, [49] = 1, [-3] = 1, [54] = 1, [-30] = 1, [-21] = 1, [36] = 1, [-48] = 1, [45] = 1, [-39] = 1, [18] = 1, [-34] = 1, [27] = 1, [-57] = 1, [0] = 1, [9] = 1, [-9] = 1, [48] = 1, [-4] = 1, [-27] = 1, [39] = 1, [-45] = 1, [44] = 1, [-40] = 1, [21] = 1, [-58] = 1, [3] = 1, [-49] = 1, [8] = 1, [-15] = 1, [51] = 1, [33] = 1, [-19] = 1, [38] = 1, [-46] = 1, [47] = 1, [-37] = 1, [20] = 1, [29] = 1}, [-33] = {[-36] = 1, [39] = 1, [21] = 1, [18] = 1, [27] = 1, [0] = 1, [-32] = 1, [9] = 1, [-33] = 1, [38] = 1, [20] = 1, [-12] = 1, [-3] = 1, [26] = 1, [-6] = 1, [3] = 1, [8] = 1, [-24] = 1, [-34] = 1, [33] = 1, [23] = 1, [-9] = 1, [5] = 1, [-27] = 1, [-30] = 1, [-21] = 1, [-39] = 1, [22] = 1, [4] = 1, [13] = 1, [17] = 1, [-15] = 1, [30] = 1, [7] = 1, [12] = 1, [-37] = 1, [37] = 1, [16] = 1, [-16] = 1, [25] = 1, [6] = 1, [15] = 1, [-17] = 1, [-35] = 1, [-38] = 1, [36] = 1, [45] = 1, [19] = 1, [24] = 1, [-31] = 1, [14] = 1, [-18] = 1}, [22] = {[12] = 1, [-39] = 1, [-27] = 1, [-24] = 1, [-3] = 1, [-42] = 1, [0] = 1, [27] = 1, [-36] = 1, [21] = 1, [-18] = 1, [24] = 1, [15] = 1, [-15] = 1}, [-27] = {[39] = 1, [32] = 1, [-36] = 1, [23] = 1, [-9] = 1, [25] = 1, [-7] = 1, [-30] = 1, [-21] = 1, [38] = 1, [47] = 1, [-37] = 1, [22] = 1, [31] = 1, [24] = 1, [-8] = 1, [-31] = 1, [51] = 1, [37] = 1, [46] = 1, [-38] = 1, [21] = 1, [30] = 1, [-1] = 1, [-2] = 1, [0] = 1, [9] = 1, [-32] = 1, [50] = 1, [36] = 1, [45] = 1, [-39] = 1, [-12] = 1, [6] = 1, [-3] = 1, [15] = 1, [49] = 1, [-24] = 1, [35] = 1, [44] = 1, [-42] = 1, [-33] = 1, [14] = 1, [-27] = 1, [-18] = 1, [48] = 1, [34] = 1, [43] = 1, [18] = 1, [27] = 1, [13] = 1, [33] = 1, [42] = 1, [26] = 1, [-15] = 1, [3] = 1, [-6] = 1, [12] = 1}, [27] = {[-39] = 1, [34] = 1, [-18] = 1, [9] = 1, [-25] = 1, [14] = 1, [7] = 1, [-11] = 1, [21] = 1, [37] = 1, [-24] = 1, [-31] = 1, [8] = 1, [-26] = 1, [6] = 1, [-12] = 1, [31] = 1, [20] = 1, [36] = 1, [-21] = 1, [-32] = 1, [11] = 1, [-7] = 1, [0] = 1, [25] = 1, [-9] = 1, [30] = 1, [39] = 1, [10] = 1, [-8] = 1, [3] = 1, [-15] = 1, [24] = 1, [-10] = 1, [17] = 1, [33] = 1, [38] = 1, [-30] = 1, [13] = 1, [-16] = 1, [27] = 1, [16] = 1, [-36] = 1, [32] = 1, [-27] = 1, [12] = 1, [-6] = 1, [5] = 1, [-13] = 1, [26] = 1, [19] = 1, [-33] = 1, [35] = 1, [-17] = 1, [15] = 1, [-3] = 1, [4] = 1, [-14] = 1, [18] = 1}, [12] = {[50] = 1, [25] = 1, [16] = 1, [-11] = 1, [15] = 1, [6] = 1, [-21] = 1, [-30] = 1, [51] = 1, [42] = 1, [33] = 1, [-36] = 1, [26] = 1, [17] = 1, [-10] = 1, [-28] = 1, [-29] = 1, [-35] = 1, [-45] = 1, [28] = 1, [27] = 1, [-8] = 1, [18] = 1, [-9] = 1, [9] = 1, [-18] = 1, [0] = 1, [-27] = 1, [45] = 1, [36] = 1, [-34] = 1, [29] = 1, [-7] = 1, [-26] = 1, [46] = 1, [37] = 1, [-33] = 1, [-42] = 1, [-51] = 1, [30] = 1, [21] = 1, [-6] = 1, [12] = 1, [-15] = 1, [-24] = 1, [-25] = 1, [48] = 1, [47] = 1, [38] = 1, [22] = 1, [4] = 1, [3] = 1, [49] = 1, [39] = 1, [-39] = 1, [-48] = 1, [24] = 1, [-3] = 1, [23] = 1, [-12] = 1, [5] = 1}, [34] = {[3] = 1, [0] = 1, [27] = 1, [18] = 1, [15] = 1, [6] = 1, [-15] = 1, [-27] = 1, [-9] = 1, [-21] = 1, [-30] = 1, [-3] = 1, [-12] = 1, [-24] = 1}, [24] = {[21] = 1, [28] = 1, [-19] = 1, [-12] = 1, [37] = 1, [-5] = 1, [44] = 1, [1] = 1, [8] = 1, [15] = 1, [29] = 1, [-32] = 1, [-18] = 1, [-11] = 1, [38] = 1, [-4] = 1, [45] = 1, [2] = 1, [9] = 1, [-33] = 1, [30] = 1, [-31] = 1, [-24] = 1, [32] = 1, [-10] = 1, [39] = 1, [-3] = 1, [3] = 1, [-39] = 1, [10] = 1, [24] = 1, [31] = 1, [-30] = 1, [33] = 1, [-9] = 1, [40] = 1, [-45] = 1, [4] = 1, [11] = 1, [18] = 1, [-29] = 1, [-15] = 1, [34] = 1, [-8] = 1, [41] = 1, [-44] = 1, [5] = 1, [12] = 1, [19] = 1, [-28] = 1, [-21] = 1, [35] = 1, [-7] = 1, [42] = 1, [-43] = 1, [6] = 1, [-36] = 1, [20] = 1, [27] = 1, [-27] = 1, [-20] = 1, [36] = 1, [-6] = 1, [43] = 1, [0] = 1, [-42] = 1, [7] = 1}, [-36] = {[16] = 1, [41] = 1, [-31] = 1, [-9] = 1, [13] = 1, [4] = 1, [-36] = 1, [3] = 1, [17] = 1, [-21] = 1, [42] = 1, [-30] = 1, [33] = 1, [-16] = 1, [14] = 1, [5] = 1, [-35] = 1, [28] = 1, [27] = 1, [18] = 1, [-28] = 1, [-29] = 1, [34] = 1, [-6] = 1, [-15] = 1, [15] = 1, [6] = 1, [-34] = 1, [29] = 1, [20] = 1, [19] = 1, [-18] = 1, [-27] = 1, [36] = 1, [35] = 1, [8] = 1, [7] = 1, [-33] = 1, [30] = 1, [21] = 1, [-17] = 1, [-26] = 1, [37] = 1, [-3] = 1, [-12] = 1, [9] = 1, [0] = 1, [22] = 1, [-24] = 1, [-25] = 1, [38] = 1, [10] = 1, [24] = 1, [23] = 1, [40] = 1, [-32] = 1, [39] = 1, [12] = 1, [11] = 1}, [0] = {[14] = 1, [5] = 1, [28] = 1, [19] = 1, [-24] = 1, [-3] = 1, [-12] = 1, [-53] = 1, [-39] = 1, [-48] = 1, [-41] = 1, [49] = 1, [8] = 1, [15] = 1, [6] = 1, [29] = 1, [20] = 1, [-23] = 1, [-32] = 1, [-1] = 1, [-2] = 1, [-11] = 1, [-52] = 1, [-38] = 1, [45] = 1, [36] = 1, [50] = 1, [9] = 1, [0] = 1, [7] = 1, [30] = 1, [21] = 1, [-22] = 1, [-31] = 1, [-10] = 1, [-51] = 1, [-60] = 1, [-37] = 1, [46] = 1, [51] = 1, [1] = 1, [24] = 1, [22] = 1, [-21] = 1, [-30] = 1, [-9] = 1, [-50] = 1, [-59] = 1, [-36] = 1, [47] = 1, [-45] = 1, [52] = 1, [2] = 1, [16] = 1, [23] = 1, [-20] = 1, [-6] = 1, [-15] = 1, [-56] = 1, [-49] = 1, [-58] = 1, [-35] = 1, [39] = 1, [53] = 1, [12] = 1, [3] = 1, [17] = 1, [-19] = 1, [-5] = 1, [-55] = 1, [-57] = 1, [42] = 1, [-34] = 1, [33] = 1, [54] = 1, [13] = 1, [4] = 1, [27] = 1, [18] = 1, [-18] = 1, [-27] = 1, [-4] = 1, [-54] = 1, [-40] = 1, [-33] = 1, [-42] = 1, [48] = 1}, [50] = {[18] = 1, [-3] = 1, [3] = 1, [0] = 1, [21] = 1}, [-50] = {[-18] = 1, [-15] = 1, [-9] = 1, [-12] = 1, [6] = 1, [9] = 1, [-3] = 1}, [35] = {[-15] = 1, [6] = 1, [15] = 1, [18] = 1, [27] = 1, [-24] = 1, [0] = 1, [-12] = 1, [-3] = 1, [-30] = 1, [-21] = 1, [3] = 1, [-9] = 1, [-27] = 1}, [1] = {[33] = 1, [-27] = 1, [-9] = 1, [-45] = 1, [-3] = 1, [12] = 1, [-30] = 1, [3] = 1, [-57] = 1, [-24] = 1, [-12] = 1, [27] = 1, [-48] = 1, [-15] = 1, [-54] = 1, [15] = 1, [0] = 1, [18] = 1, [24] = 1, [-36] = 1}, [-48] = {[12] = 1, [3] = 1, [-19] = 1, [4] = 1, [-16] = 1, [-9] = 1, [-18] = 1, [5] = 1, [-6] = 1, [-15] = 1, [-17] = 1, [8] = 1, [6] = 1, [-14] = 1, [18] = 1, [9] = 1, [0] = 1, [7] = 1, [-13] = 1, [1] = 1, [-3] = 1, [-12] = 1, [-21] = 1, [2] = 1, [-20] = 1}, [4] = {[42] = 1, [-30] = 1, [-48] = 1, [-33] = 1, [18] = 1, [15] = 1, [-57] = 1, [48] = 1, [-21] = 1, [-39] = 1, [39] = 1, [-45] = 1, [3] = 1, [-18] = 1, [-36] = 1, [33] = 1, [-42] = 1, [-6] = 1}, [45] = {[-9] = 1, [19] = 1, [12] = 1, [5] = 1, [-3] = 1, [18] = 1, [11] = 1, [4] = 1, [-4] = 1, [-18] = 1, [24] = 1, [10] = 1, [3] = 1, [-5] = 1, [-12] = 1, [23] = 1, [9] = 1, [2] = 1, [-6] = 1, [-13] = 1, [-27] = 1, [22] = 1, [15] = 1, [1] = 1, [-14] = 1, [21] = 1, [0] = 1, [-15] = 1, [20] = 1, [6] = 1}, [7] = {[15] = 1, [45] = 1, [42] = 1, [-57] = 1, [24] = 1, [-9] = 1, [9] = 1, [-45] = 1, [36] = 1, [39] = 1, [21] = 1, [18] = 1, [48] = 1, [-54] = 1, [3] = 1, [-6] = 1, [-24] = 1, [33] = 1, [-39] = 1, [-42] = 1}, [8] = {[45] = 1, [-54] = 1, [39] = 1, [-42] = 1, [33] = 1, [24] = 1, [-6] = 1, [-24] = 1, [18] = 1, [42] = 1, [-39] = 1, [-57] = 1, [15] = 1, [36] = 1, [-45] = 1, [9] = 1, [48] = 1, [21] = 1, [3] = 1, [-9] = 1}, [-44] = {[-24] = 1, [-9] = 1, [12] = 1, [18] = 1, [6] = 1, [33] = 1, [-15] = 1, [9] = 1, [-3] = 1, [3] = 1}, [-12] = {[-47] = 1, [-40] = 1, [41] = 1, [48] = 1, [6] = 1, [-24] = 1, [-9] = 1, [20] = 1, [-1] = 1, [-2] = 1, [19] = 1, [-46] = 1, [-39] = 1, [36] = 1, [42] = 1, [49] = 1, [-30] = 1, [21] = 1, [27] = 1, [-51] = 1, [-45] = 1, [-38] = 1, [50] = 1, [-28] = 1, [-29] = 1, [0] = 1, [15] = 1, [-15] = 1, [22] = 1, [-50] = 1, [-36] = 1, [-37] = 1, [45] = 1, [52] = 1, [51] = 1, [-27] = 1, [-21] = 1, [-14] = 1, [23] = 1, [30] = 1, [-49] = 1, [-42] = 1, [39] = 1, [46] = 1, [53] = 1, [-26] = 1, [-12] = 1, [9] = 1, [-13] = 1, [16] = 1, [-6] = 1, [-41] = 1, [47] = 1, [54] = 1, [-25] = 1, [-18] = 1, [3] = 1, [-11] = 1, [17] = 1, [24] = 1, [-48] = 1, [-33] = 1, [33] = 1, [40] = 1, [12] = 1, [-10] = 1, [-3] = 1, [18] = 1}, [54] = {[-1] = 1, [-2] = 1, [13] = 1, [2] = 1, [-4] = 1, [-9] = 1, [3] = 1, [-6] = 1, [-3] = 1, [-12] = 1, [9] = 1, [0] = 1, [18] = 1, [-5] = 1, [14] = 1, [1] = 1, [-8] = 1, [15] = 1, [6] = 1, [-7] = 1, [12] = 1}, [-15] = {[37] = 1, [-33] = 1, [-48] = 1, [27] = 1, [21] = 1, [-18] = 1, [-25] = 1, [42] = 1, [36] = 1, [-41] = 1, [26] = 1, [-6] = 1, [6] = 1, [-12] = 1, [48] = 1, [-26] = 1, [41] = 1, [-42] = 1, [25] = 1, [18] = 1, [11] = 1, [-7] = 1, [12] = 1, [-21] = 1, [-27] = 1, [40] = 1, [33] = 1, [-37] = 1, [-36] = 1, [24] = 1, [10] = 1, [-8] = 1, [3] = 1, [-15] = 1, [47] = 1, [32] = 1, [-38] = 1, [31] = 1, [9] = 1, [-16] = 1, [-30] = 1, [46] = 1, [39] = 1, [-39] = 1, [30] = 1, [23] = 1, [-9] = 1, [-24] = 1, [45] = 1, [38] = 1, [-40] = 1, [22] = 1, [15] = 1, [-3] = 1, [0] = 1, [-17] = 1}, [29] = {[-24] = 1, [-6] = 1, [27] = 1, [36] = 1, [0] = 1, [-36] = 1, [24] = 1, [33] = 1, [-21] = 1, [12] = 1, [30] = 1, [-30] = 1, [3] = 1, [21] = 1}, [26] = {[-3] = 1, [-24] = 1, [-6] = 1, [-39] = 1, [27] = 1, [-36] = 1, [30] = 1, [-30] = 1, [3] = 1, [0] = 1}, [-39] = {[12] = 1, [21] = 1, [-17] = 1, [-16] = 1, [37] = 1, [-34] = 1, [-27] = 1, [-18] = 1, [-9] = 1, [35] = 1, [36] = 1, [-35] = 1, [0] = 1, [9] = 1, [18] = 1, [-29] = 1, [-28] = 1, [34] = 1, [-36] = 1, [7] = 1, [8] = 1, [17] = 1, [-30] = 1, [-21] = 1, [33] = 1, [6] = 1, [15] = 1, [16] = 1, [-12] = 1, [-3] = 1, [5] = 1, [23] = 1, [24] = 1, [39] = 1, [3] = 1, [4] = 1, [22] = 1, [-24] = 1, [-15] = 1, [-6] = 1, [38] = 1, [-33] = 1}, [13] = {[6] = 1, [-3] = 1, [-24] = 1, [12] = 1, [-33] = 1, [-18] = 1, [24] = 1, [3] = 1, [-42] = 1, [-6] = 1, [9] = 1, [45] = 1, [-21] = 1, [-51] = 1, [-15] = 1, [21] = 1, [0] = 1, [-45] = 1, [27] = 1}, [25] = {[3] = 1, [30] = 1, [-36] = 1, [-30] = 1, [0] = 1, [27] = 1, [-3] = 1, [-39] = 1, [-24] = 1, [-6] = 1}, [28] = {[24] = 1, [-21] = 1, [-30] = 1, [12] = 1, [-6] = 1, [3] = 1, [33] = 1, [27] = 1, [-24] = 1, [36] = 1, [30] = 1, [21] = 1, [0] = 1, [-36] = 1}, [-13] = {[39] = 1, [3] = 1, [33] = 1, [-36] = 1, [30] = 1, [-6] = 1, [-33] = 1, [-12] = 1, [-3] = 1, [-48] = 1, [18] = 1, [-9] = 1, [12] = 1, [21] = 1, [-15] = 1, [6] = 1, [15] = 1, [-30] = 1, [-21] = 1, [0] = 1, [-27] = 1}, [-22] = {[-30] = 1, [36] = 1, [3] = 1, [-15] = 1, [30] = 1, [0] = 1, [-9] = 1, [6] = 1, [-12] = 1, [21] = 1, [9] = 1, [18] = 1, [-3] = 1, [33] = 1, [-42] = 1, [-6] = 1, [-27] = 1, [39] = 1}, [44] = {[15] = 1, [6] = 1, [-3] = 1, [-12] = 1, [18] = 1, [9] = 1, [-9] = 1, [-18] = 1, [-27] = 1, [24] = 1}, [38] = {[9] = 1, [0] = 1, [6] = 1, [-21] = 1, [-15] = 1, [-24] = 1, [24] = 1, [3] = 1}, [-25] = {[-6] = 1, [-24] = 1, [9] = 1, [6] = 1, [42] = 1, [-21] = 1, [-12] = 1, [21] = 1, [18] = 1, [0] = 1, [-30] = 1, [3] = 1, [-36] = 1, [12] = 1, [-15] = 1, [-18] = 1, [33] = 1, [-39] = 1}, [53] = {[9] = 1, [18] = 1, [6] = 1, [3] = 1, [12] = 1, [-12] = 1}, [-23] = {[6] = 1, [18] = 1, [-12] = 1, [-3] = 1, [39] = 1, [3] = 1, [-27] = 1, [-15] = 1, [-6] = 1, [-42] = 1, [-30] = 1, [36] = 1, [0] = 1, [9] = 1, [-9] = 1, [21] = 1, [30] = 1, [33] = 1}, [5] = {[39] = 1, [-45] = 1, [-36] = 1, [18] = 1, [3] = 1, [-18] = 1, [-48] = 1, [-39] = 1, [-42] = 1, [-33] = 1, [-6] = 1, [48] = 1, [-57] = 1, [15] = 1, [-30] = 1, [-21] = 1, [33] = 1, [42] = 1}, [-5] = {[45] = 1, [0] = 1, [24] = 1, [-18] = 1, [27] = 1, [-45] = 1, [-24] = 1, [12] = 1, [-21] = 1, [-9] = 1, [18] = 1, [-36] = 1, [-15] = 1, [21] = 1, [-33] = 1, [-30] = 1}, [-41] = {[3] = 1, [12] = 1, [-15] = 1, [-27] = 1, [-3] = 1, [18] = 1, [-18] = 1, [6] = 1, [-12] = 1, [-24] = 1, [0] = 1, [-9] = 1, [36] = 1}, [-2] = {[42] = 1, [45] = 1, [-12] = 1, [15] = 1, [-42] = 1, [27] = 1, [12] = 1, [33] = 1, [-6] = 1, [-3] = 1, [3] = 1, [-30] = 1, [-27] = 1, [39] = 1, [36] = 1, [-45] = 1, [6] = 1, [9] = 1, [-9] = 1, [18] = 1, [21] = 1, [-24] = 1}, [-19] = {[18] = 1, [45] = 1, [-30] = 1, [-24] = 1, [-18] = 1, [21] = 1, [-12] = 1, [0] = 1, [-33] = 1, [27] = 1, [-6] = 1, [-48] = 1, [12] = 1, [-21] = 1, [-42] = 1}, [-1] = {[42] = 1, [45] = 1, [-12] = 1, [15] = 1, [-42] = 1, [27] = 1, [12] = 1, [33] = 1, [-6] = 1, [-3] = 1, [3] = 1, [-30] = 1, [-27] = 1, [39] = 1, [36] = 1, [-45] = 1, [6] = 1, [9] = 1, [-9] = 1, [18] = 1, [21] = 1, [-24] = 1}, [-37] = {[-33] = 1, [-3] = 1, [36] = 1, [0] = 1, [3] = 1, [-24] = 1, [-12] = 1, [-21] = 1, [-9] = 1, [12] = 1, [-15] = 1, [15] = 1, [21] = 1, [-27] = 1, [-6] = 1}, [23] = {[-15] = 1, [0] = 1, [-27] = 1, [24] = 1, [-39] = 1, [-42] = 1, [-3] = 1, [12] = 1, [27] = 1, [-18] = 1, [15] = 1, [21] = 1, [-24] = 1, [-36] = 1}, [-29] = {[-9] = 1, [-27] = 1, [30] = 1, [-15] = 1, [12] = 1, [6] = 1, [27] = 1, [0] = 1, [42] = 1, [-42] = 1, [21] = 1, [3] = 1, [-18] = 1, [-39] = 1, [-6] = 1, [39] = 1, [-3] = 1, [-30] = 1, [-21] = 1, [33] = 1}, [-17] = {[33] = 1, [12] = 1, [18] = 1, [-24] = 1, [-15] = 1, [6] = 1, [-36] = 1, [-27] = 1, [-30] = 1, [0] = 1, [45] = 1, [3] = 1, [-48] = 1, [39] = 1, [-12] = 1, [-3] = 1, [-6] = 1}, [-8] = {[-21] = 1, [-48] = 1, [3] = 1, [-27] = 1, [24] = 1, [45] = 1, [-33] = 1, [-12] = 1, [54] = 1, [-45] = 1, [-24] = 1, [48] = 1, [0] = 1, [-30] = 1, [21] = 1, [15] = 1, [36] = 1}, [-32] = {[0] = 1, [30] = 1, [21] = 1, [-18] = 1, [-27] = 1, [45] = 1, [36] = 1, [-24] = 1, [-3] = 1, [-12] = 1, [3] = 1, [-36] = 1, [-21] = 1, [-30] = 1, [-9] = 1, [33] = 1, [-6] = 1}, [-26] = {[42] = 1, [-6] = 1, [-12] = 1, [6] = 1, [18] = 1, [21] = 1, [12] = 1, [-36] = 1, [-21] = 1, [-30] = 1, [33] = 1, [-15] = 1, [-24] = 1, [3] = 1, [9] = 1, [0] = 1, [-39] = 1, [-18] = 1}, [10] = {[12] = 1, [-21] = 1, [-48] = 1, [-24] = 1, [33] = 1, [3] = 1, [-18] = 1, [-39] = 1, [0] = 1, [-3] = 1, [36] = 1, [-33] = 1, [-6] = 1, [-27] = 1, [51] = 1, [21] = 1, [9] = 1, [45] = 1, [-15] = 1, [15] = 1, [42] = 1}, [-54] = {[-10] = 1, [-15] = 1, [-9] = 1, [-12] = 1, [-11] = 1, [-18] = 1, [-17] = 1, [-6] = 1, [12] = 1, [-16] = 1}, [6] = {[51] = 1, [42] = 1, [45] = 1, [36] = 1, [31] = 1, [-13] = 1, [-22] = 1, [9] = 1, [0] = 1, [-33] = 1, [-42] = 1, [48] = 1, [34] = 1, [-21] = 1, [-30] = 1, [1] = 1, [-27] = 1, [-36] = 1, [49] = 1, [-50] = 1, [35] = 1, [26] = 1, [-1] = 1, [-2] = 1, [-15] = 1, [20] = 1, [-24] = 1, [15] = 1, [6] = 1, [-49] = 1, [-58] = 1, [32] = 1, [27] = 1, [18] = 1, [-10] = 1, [21] = 1, [-23] = 1, [12] = 1, [7] = 1, [-52] = 1, [-57] = 1, [46] = 1, [33] = 1, [24] = 1, [19] = 1, [-9] = 1, [10] = 1, [-18] = 1, [4] = 1, [-45] = 1, [-54] = 1, [-51] = 1, [-60] = 1, [47] = 1, [-6] = 1, [25] = 1, [-3] = 1, [-12] = 1, [11] = 1, [2] = 1, [-26] = 1, [5] = 1, [-39] = 1, [-48] = 1, [-53] = 1, [-59] = 1, [50] = 1, [39] = 1, [30] = 1, [-14] = 1, [-11] = 1, [8] = 1, [3] = 1, [-25] = 1}, [40] = {[-9] = 1, [-27] = 1, [-15] = 1, [6] = 1, [18] = 1, [0] = 1, [-6] = 1, [3] = 1, [-21] = 1}, [-35] = {[-12] = 1, [0] = 1, [-6] = 1, [-18] = 1, [30] = 1, [-27] = 1, [-9] = 1, [3] = 1, [-21] = 1, [-3] = 1, [36] = 1}, [60] = {[2] = 1, [3] = 1, [6] = 1, [8] = 1, [7] = 1, [9] = 1, [0] = 1, [1] = 1}, [20] = {[3] = 1, [24] = 1, [-42] = 1, [39] = 1, [-27] = 1, [-48] = 1, [21] = 1, [27] = 1, [0] = 1, [-39] = 1, [-3] = 1, [-36] = 1}, [31] = {[-12] = 1, [-6] = 1, [-24] = 1, [24] = 1, [-9] = 1, [3] = 1, [-15] = 1, [33] = 1, [-18] = 1, [30] = 1}, [57] = {[2] = 1, [11] = 1, [12] = 1, [1] = 1, [10] = 1, [0] = 1, [9] = 1, [-3] = 1, [6] = 1, [5] = 1, [3] = 1, [4] = 1}, [-10] = {[-36] = 1, [3] = 1, [45] = 1, [36] = 1, [9] = 1, [0] = 1, [27] = 1, [-21] = 1, [-45] = 1, [-24] = 1, [-6] = 1, [15] = 1, [6] = 1, [12] = 1, [30] = 1, [-18] = 1, [51] = 1, [-33] = 1}, [-31] = {[3] = 1, [-21] = 1, [21] = 1, [-27] = 1, [-9] = 1, [45] = 1, [-3] = 1, [0] = 1, [-30] = 1, [-24] = 1, [-6] = 1, [36] = 1, [-12] = 1, [-36] = 1, [30] = 1, [-18] = 1, [33] = 1}, [-57] = {[-11] = 1, [-12] = 1, [-9] = 1, [-10] = 1, [-15] = 1}, [14] = {[12] = 1, [-45] = 1, [3] = 1, [0] = 1, [21] = 1, [-21] = 1, [-24] = 1, [-6] = 1, [-3] = 1, [-42] = 1, [45] = 1, [6] = 1, [9] = 1, [27] = 1, [24] = 1, [-18] = 1, [-15] = 1, [-51] = 1, [-33] = 1}, [-40] = {[-27] = 1, [3] = 1, [-12] = 1, [-18] = 1, [18] = 1, [-24] = 1, [12] = 1, [-3] = 1, [6] = 1, [-9] = 1, [36] = 1, [0] = 1, [-15] = 1}, [33] = {[-21] = 1, [11] = 1, [12] = 1, [-27] = 1, [5] = 1, [-1] = 1, [-2] = 1, [30] = 1, [-9] = 1, [33] = 1, [10] = 1, [3] = 1, [4] = 1, [-3] = 1, [29] = 1, [-33] = 1, [9] = 1, [-30] = 1, [2] = 1, [27] = 1, [28] = 1, [21] = 1, [-24] = 1, [8] = 1, [-31] = 1, [1] = 1, [-6] = 1, [19] = 1, [-12] = 1, [20] = 1, [15] = 1, [-32] = 1, [0] = 1, [18] = 1, [-18] = 1, [14] = 1, [-25] = 1, [7] = 1, [24] = 1, [-15] = 1, [17] = 1, [13] = 1, [-26] = 1, [6] = 1, [16] = 1}, [-14] = {[-21] = 1, [-30] = 1, [30] = 1, [33] = 1, [-15] = 1, [3] = 1, [39] = 1, [-9] = 1, [0] = 1, [-48] = 1, [-3] = 1, [-12] = 1, [15] = 1, [6] = 1, [-33] = 1, [-6] = 1, [21] = 1, [12] = 1, [-36] = 1, [18] = 1, [-27] = 1}, [2] = {[3] = 1, [-54] = 1, [-36] = 1, [0] = 1, [27] = 1, [18] = 1, [15] = 1, [24] = 1, [-15] = 1, [12] = 1, [-27] = 1, [-9] = 1, [-30] = 1, [-3] = 1, [-12] = 1, [-45] = 1, [33] = 1, [-24] = 1, [-57] = 1, [-48] = 1}, [-55] = {[-12] = 1, [-15] = 1}, [42] = {[13] = 1, [-9] = 1, [-1] = 1, [-2] = 1, [-21] = 1, [24] = 1, [3] = 1, [10] = 1, [-12] = 1, [0] = 1, [11] = 1, [-11] = 1, [-18] = 1, [20] = 1, [6] = 1, [8] = 1, [-3] = 1, [-17] = 1, [21] = 1, [7] = 1, [14] = 1, [9] = 1, [-6] = 1, [-27] = 1, [18] = 1, [15] = 1, [-16] = 1, [19] = 1, [12] = 1, [-10] = 1, [-15] = 1}, [-16] = {[-36] = 1, [39] = 1, [33] = 1, [-27] = 1, [6] = 1, [-6] = 1, [-15] = 1, [-24] = 1, [18] = 1, [0] = 1, [45] = 1, [-48] = 1, [-3] = 1, [-12] = 1, [-30] = 1, [12] = 1, [3] = 1}, [-20] = {[-33] = 1, [-42] = 1, [27] = 1, [18] = 1, [0] = 1, [-12] = 1, [-21] = 1, [-30] = 1, [-48] = 1, [21] = 1, [12] = 1, [-18] = 1, [-6] = 1, [-24] = 1, [45] = 1}, [55] = {[3] = 1, [12] = 1, [-3] = 1}, [-49] = {[-15] = 1, [6] = 1, [9] = 1, [-12] = 1, [-3] = 1, [-18] = 1, [-9] = 1}, [-52] = {[-12] = 1, [12] = 1, [-6] = 1, [-15] = 1}, [52] = {[12] = 1, [18] = 1, [6] = 1, [-12] = 1, [9] = 1, [3] = 1}, [37] = {[3] = 1, [-24] = 1, [24] = 1, [0] = 1, [9] = 1, [6] = 1, [-15] = 1, [-21] = 1}, [49] = {[0] = 1, [21] = 1, [18] = 1, [3] = 1, [-3] = 1}, [-28] = {[-6] = 1, [21] = 1, [27] = 1, [-30] = 1, [3] = 1, [-39] = 1, [39] = 1, [-3] = 1, [30] = 1, [12] = 1, [-9] = 1, [-27] = 1, [-21] = 1, [6] = 1, [33] = 1, [-42] = 1, [-15] = 1, [-18] = 1, [0] = 1, [42] = 1}, [-47] = {[-6] = 1, [-12] = 1, [-21] = 1, [18] = 1, [12] = 1, [-9] = 1, [9] = 1, [-3] = 1}, [-38] = {[-21] = 1, [-3] = 1, [15] = 1, [-24] = 1, [-6] = 1, [12] = 1, [-33] = 1, [36] = 1, [-15] = 1, [3] = 1, [21] = 1, [-27] = 1, [-9] = 1, [0] = 1, [-12] = 1}, [-53] = {[-15] = 1, [12] = 1, [-6] = 1, [-12] = 1}, [16] = {[21] = 1, [12] = 1, [-6] = 1, [-24] = 1, [33] = 1, [24] = 1, [-33] = 1, [6] = 1, [-12] = 1, [-39] = 1, [-48] = 1, [36] = 1, [27] = 1, [18] = 1, [9] = 1, [0] = 1}, [59] = {[6] = 1, [0] = 1}, [41] = {[-27] = 1, [6] = 1, [-15] = 1, [18] = 1, [-6] = 1, [3] = 1, [-21] = 1, [-9] = 1, [0] = 1}, [63] = {[0] = 1}, [47] = {[24] = 1, [12] = 1, [21] = 1, [18] = 1, [6] = 1, [-6] = 1, [9] = 1, [-9] = 1, [3] = 1}, [61] = {[0] = 1}, [43] = {[-18] = 1, [24] = 1, [15] = 1, [-3] = 1, [9] = 1, [6] = 1, [-12] = 1, [18] = 1, [-9] = 1, [-27] = 1}, [-56] = {[-15] = 1, [-12] = 1}, [56] = {[3] = 1, [-3] = 1, [12] = 1}, [62] = {[0] = 1}, [58] = {[0] = 1, [6] = 1}} - -local function build_intersection(type, origin, rot) - local surface = game.surfaces[1] - for _, v in pairs(rail_grid[type]) do - local pos = rot_pos(v.position, rot) - local dir = rot_dir(v.direction, rot) - surface.create_entity{name=v.name, position={origin.x + pos.x, origin.y + pos.y}, force="neutral", direction=dir} - end -end - --- dirs : {E, S, W, N}, array of 0/1 -local function build_chunk(origin, dirs) - local surface = game.surfaces[1] - local cnt = 0 - local sum = {x = 0, y = 0} - local delta = {x = 1, y = 0} - for dir, b in ipairs(dirs) do - cnt = cnt + b - sum = {x = sum.x + delta.x * b, y = sum.y + delta.y * b} - delta = {x = -delta.y, y = delta.x} - if b == 1 and paddings[dir*2] ~= nil then - -- build paddings - for _, v in pairs(paddings[dir*2]) do - surface.create_entity{name=v.name, position={origin.x + v.position.x, origin.y + v.position.y}, force="neutral", direction=v.direction} - end - end - end - - if cnt == 4 then - build_intersection("allway", origin, {x = 1, y = 0}) - elseif cnt == 3 then - build_intersection("tshape", origin, {x = sum.y, y = -sum.x}) - elseif cnt == 2 then - if sum.x == 0 and sum.y == 0 then - build_intersection("straight", origin, {x = dirs[1], y = dirs[2]}) - else - build_intersection("corner", origin, {x = (sum.y - sum.x) / 2, y = -(sum.y + sum.x) / 2}) - end - elseif cnt == 1 then - build_intersection("ushape", origin, {x = -sum.x, y = -sum.y}) - end -end - -local function is_on_grid(gx, gy) - if bitmap[gx] and bitmap[gx][gy] == 1 then - return true - else - return false - end -end - -local function find_connections(gx, gy) - local dd = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}} - if is_on_grid(gx, gy) then - local c = {} - for _, d in ipairs(dd) do - if is_on_grid(gx + d[1], gy + d[2]) then - table.insert(c, 1) - else - table.insert(c, 0) - end - end - return c - else - return {0,0,0,0} - end -end - -local function disable_items() - force = game.forces["player"] - force.recipes["logistic-chest-requester"].enabled = false - force.recipes["underground-belt"].enabled = false - force.recipes["fast-underground-belt"].enabled = false - force.recipes["express-underground-belt"].enabled = false -end - - -function mymodule.on_chunk_generated(event) - local bd_box = event.area - local surface = event.surface - local chunk_size = 32 - -- assert(chunk_size == bd_box.right_bottom.x - bd_box.left_top.x) - -- assert(chunk_size == bd_box.right_bottom.y - bd_box.left_top.y) - if surface ~= game.surfaces[1] then return end - - local gx = bd_box.left_top.x / 32 - local gy = bd_box.left_top.y / 32 - - if is_on_grid(gx, gy) then - -- remove trees and resources - for _, e in pairs(surface.find_entities_filtered{area=bd_box, type="tree"}) do - e.destroy() - end - for _, e in pairs(surface.find_entities_filtered{area=bd_box, type="resource"}) do - e.destroy() - end - for _, e in pairs(surface.find_entities_filtered{area=bd_box, type="simple-entity"}) do - e.destroy() - end - build_chunk({x=gx*chunk_size, y=gy*chunk_size}, find_connections(gx, gy)) - end -end - - - -return mymodule diff --git a/locale/map_layout/sample.lua b/locale/map_layout/sample.lua deleted file mode 100644 index 2a1225ee..00000000 --- a/locale/map_layout/sample.lua +++ /dev/null @@ -1,26 +0,0 @@ ---[[ -This is a sample file for a map style. You may register new events, but not on_chunk_generated. - -Author: Valansch -]]-- - - ---This is contains the module (Do not remove) -local module = {} - -local example_variable = "foo" - -local function helper_function() - --helper function code here -end - ---This function is called by the framework if the style is enabled. -function module.on_chunk_generated(event) - game.print("Chunk was generated") -end - - - ---(Do not remove) -return module ---any code past this point will obviously not be executed diff --git a/locale/map_layout/shapes.lua b/locale/map_layout/shapes.lua deleted file mode 100644 index 6e7c0e09..00000000 --- a/locale/map_layout/shapes.lua +++ /dev/null @@ -1,44 +0,0 @@ ---Author Valansch - - - -Compass = { - east={x=1,y=0,next="north"}, - north={x=0,y=-1,next="west"}, - west={x=-1,y=0,next="south"}, - south={x=0,y=1,next="east"}, - direction="west"} -function Compass.turn() - Compass.direction=Compass[Compass.direction].next -end -function Compass.getdirection() - return Compass[Compass.direction] -end - ---spiral -Spiral = {Pixels={}, width = 4, size = 10} -function Spiral.onshape(p) - x = math.floor(p[1]/32/Spiral.width) - y = math.floor(p[2]/32/Spiral.width) - return Spiral.Pixels[x .. "," .. y] ~= nil -end -function Spiral.add(p) - Spiral.Pixels[p[1].. "," .. p[2]] = true -end -function Spiral.takesteps(p, n) - direction = Compass.getdirection() - for i = 1, n do - p[1] = p[1] + direction["x"] - p[2] = p[2] + direction["y"] - Spiral.add(p) - end - return p -end -function Spiral.build() - p = {-1,-1} - Spiral.add(p) - for i = 1, 100 do - p = Spiral.takesteps(p, i) - Compass.turn() - end -end