1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-14 10:13:13 +02:00
RedMew/rail_grid.lua
2017-07-06 19:36:24 +02:00

137 lines
57 KiB
Lua

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
local function on_init()
global.map_gen_rng = game.create_random_generator()
end
local function 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
Event.register(defines.events.on_chunk_generated, on_chunk_generated)
Event.register(defines.events.on_research_finished, disable_items)
Event.register(-1, on_init)