Reduce tilemap size

master
Louis Pearson 2022-01-22 16:31:12 -07:00
parent eb73783580
commit 19a1b8cad7
6 changed files with 56 additions and 56 deletions

View File

@ -2,9 +2,9 @@ const std = @import("std");
const Vec2 = std.meta.Vector(2,i32); const Vec2 = std.meta.Vector(2,i32);
const Wire = struct { p1: Vec2, p2: Vec2, a1: bool, a2: bool }; const Wire = struct { p1: Vec2, p2: Vec2, a1: bool, a2: bool };
pub const solid_size: Vec2 = Vec2{ 20, 20 }; pub const solid_size: Vec2 = Vec2{ 20, 20 };
pub const solid: [400]u8 = .{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1, 1, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 36, 19, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 36, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 54, 36, 1, 39, 0, 50, 19, 19, 19, 22, 22, 22, 19, 19, 19, 19, 52, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 37, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 22, 52, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 37, 54, 19, 52, 1, 1, 1, 1, 1, 1, 1, 1, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 36, 52, 0, 0, 0, 20, 0, 0, 17, 19, 19, 19, 19, 19, 19, 19, 19, 36, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 1, 20, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 54, 66, 52, 0, 0, 1, 51, 0, 50, 19, 19, 19, 19, 19, 19, 19, 19, 19, 66, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 1, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; pub const solid: [400]u8 = .{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1, 1, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 36, 19, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 36, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 54, 36, 1, 39, 0, 50, 19, 19, 19, 22, 22, 22, 19, 19, 19, 19, 52, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 37, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 22, 52, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 37, 54, 19, 52, 1, 1, 1, 1, 1, 1, 1, 1, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 36, 52, 0, 0, 0, 20, 0, 0, 17, 19, 19, 19, 19, 19, 19, 19, 19, 36, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 1, 20, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 54, 66, 52, 0, 0, 1, 51, 0, 50, 19, 19, 19, 19, 19, 19, 19, 19, 19, 66, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
pub const conduit_size: Vec2 = Vec2{ 20, 20 }; pub const conduit_size: Vec2 = Vec2{ 20, 20 };
pub const conduit: [400]u8 = .{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 129, 153, 0, 0, 0, 0, 0, 0, 154, 153, 0, 0, 0, 0, 0, 0, 154, 130, 0, 0, 135, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 132, 0, 131, 146, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
pub const spawn: Vec2 = Vec2{ 0, 17 }; pub const spawn: Vec2 = Vec2{ 0, 17 };
pub const wire: [3]Wire = [_]Wire{.{.a1 = true, .a2 = true,.p1 = Vec2{ 20, 20 },.p2 = Vec2{ 76, 20 },}, .{.a1 = true, .a2 = false,.p1 = Vec2{ 84, 20 },.p2 = Vec2{ 140, 20 },}, .{.a1 = false, .a2 = false,.p1 = Vec2{ 84, 93 },.p2 = Vec2{ 140, 93 },}, }; pub const wire: [3]Wire = [_]Wire{.{.a1 = true, .a2 = true,.p1 = Vec2{ 20, 20 },.p2 = Vec2{ 76, 20 },}, .{.a1 = true, .a2 = false,.p1 = Vec2{ 84, 20 },.p2 = Vec2{ 140, 20 },}, .{.a1 = false, .a2 = false,.p1 = Vec2{ 84, 93 },.p2 = Vec2{ 140, 93 },}, };
pub const doors: [2]Vec2 = [_]Vec2{Vec2{ 18, 17 },Vec2{ 9, 15 },}; pub const doors: [2]Vec2 = [_]Vec2{Vec2{ 18, 17 },Vec2{ 9, 15 },};

View File

@ -3,7 +3,7 @@
"infinite":false, "infinite":false,
"layers":[ "layers":[
{ {
"data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1, 1, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 36, 19, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 36, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 54, 36, 1, 39, 0, 50, 19, 19, 19, 22, 22, 22, 19, 19, 19, 19, 52, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 37, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 22, 52, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 37, 54, 19, 52, 1, 1, 1, 1, 1, 1, 1, 1, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 36, 52, 0, 0, 0, 20, 0, 0, 17, 19, 19, 19, 19, 19, 19, 19, 19, 36, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 1, 20, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 54, 66, 52, 0, 0, 1, 51, 0, 50, 19, 19, 19, 19, 19, 19, 19, 19, 19, 66, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 1, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 1, 1, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 36, 19, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 36, 1, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 54, 36, 1, 39, 0, 50, 19, 19, 19, 22, 22, 22, 19, 19, 19, 19, 52, 0, 0, 0, 0, 37, 1, 39, 0, 0, 0, 0, 0, 37, 1, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 22, 52, 0, 0, 0, 37, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 37, 54, 19, 52, 1, 1, 1, 1, 1, 1, 1, 1, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 36, 52, 0, 0, 0, 20, 0, 0, 17, 19, 19, 19, 19, 19, 19, 19, 19, 36, 1, 1, 39, 0, 0, 0, 0, 20, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 50, 67, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 1, 39, 0, 0, 0, 1, 20, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 37, 1, 54, 66, 52, 0, 0, 1, 51, 0, 50, 19, 19, 19, 19, 19, 19, 19, 19, 19, 66, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
"height":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27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":20, "height":20,
"id":2, "id":2,
"name":"conduit", "name":"conduit",

View File

@ -21,9 +21,9 @@
1,36,52,0,0,0,20,0,0,17,19,19,19,19,19,19,19,19,36,1, 1,36,52,0,0,0,20,0,0,17,19,19,19,19,19,19,19,19,36,1,
1,39,0,0,0,0,20,0,0,20,0,0,0,0,0,0,0,0,37,1, 1,39,0,0,0,0,20,0,0,20,0,0,0,0,0,0,0,0,37,1,
1,39,0,0,0,50,67,0,0,51,0,0,0,0,0,0,0,0,37,1, 1,39,0,0,0,50,67,0,0,51,0,0,0,0,0,0,0,0,37,1,
1,39,0,0,0,1,20,0,0,35,0,0,0,0,0,0,0,0,37,1, 1,39,0,0,0,1,20,0,0,3,0,0,0,0,0,0,0,0,37,1,
54,66,52,0,0,1,51,0,50,19,19,19,19,19,19,19,19,19,66,54, 54,66,52,0,0,1,51,0,50,19,19,19,19,19,19,19,19,19,66,54,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,1,
22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22, 22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
</data> </data>
@ -32,21 +32,21 @@
<data encoding="csv"> <data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,129,153,0,0,0,0,0,0,154,153,0,0,0,0,0,0,154,130,0, 0,24,46,0,0,0,0,0,0,47,46,0,0,0,0,0,0,47,25,0,
0,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0, 0,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
131,146,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0, 26,41,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,129,153,0,0,0,0,0,0,154,179,0, 0,0,0,0,0,0,0,0,0,24,46,0,0,0,0,0,0,47,74,0,
0,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,132,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,163,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,27,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,132,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,163,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 680 B

File diff suppressed because one or more lines are too long

View File

@ -9,22 +9,22 @@ pub fn is_circuit(tile: u8) bool {
} }
pub fn is_plug(tile: u8) bool { pub fn is_plug(tile: u8) bool {
return (tile >= 149 and tile <= 153) or tile == 147; return (tile >= 43 and tile <= 46) or tile == 41;
} }
pub fn is_conduit(tile: u8) bool { pub fn is_conduit(tile: u8) bool {
return (tile >= 128 and tile < 132) or return (tile >= 23 and tile <= 26) or
(tile >= 144 and tile < 148) or (tile >= 39 and tile <= 42) or
(tile >= 160 and tile < 164) or (tile >= 55 and tile <= 58) or
(tile >= 176 and tile < 180); (tile >= 71 and tile <= 74);
} }
pub fn is_switch(tile: u8) bool { pub fn is_switch(tile: u8) bool {
return tile >= 134 and tile < 136; return tile >= 27 and tile <= 28;
} }
pub fn toggle_switch(tile: u8) u8 { pub fn toggle_switch(tile: u8) u8 {
return if (tile == 134) 135 else 134; return if (tile == 27) 28 else 27;
} }
const Side = enum(u2) { up, right, down, left }; const Side = enum(u2) { up, right, down, left };
@ -46,33 +46,33 @@ const Current = [4]bool;
fn get_inputs(tile: u8) Current { fn get_inputs(tile: u8) Current {
return switch (tile) { return switch (tile) {
// Corners // Corners
128 => .{ false, true, true, false }, 23 => .{ false, true, true, false },
129 => .{ false, false, true, true }, 24 => .{ false, false, true, true },
144 => .{ true, false, false, true }, 39 => .{ true, false, false, true },
145 => .{ true, true, false, false }, 40 => .{ true, true, false, false },
// Straight // Straight
130 => .{ false, true, false, true }, 25 => .{ false, true, false, true },
131 => .{ true, false, true, false }, 26 => .{ true, false, true, false },
// Cross // Cross
146 => .{ false, false, false, false }, 41 => .{ false, false, false, false },
147 => .{ true, true, true, true }, 42 => .{ true, true, true, true },
// Ends // Ends
160 => .{ false, false, true, false }, 55 => .{ false, false, true, false },
161 => .{ false, true, false, false }, 56 => .{ false, true, false, false },
162 => .{ true, false, false, false }, 57 => .{ true, false, false, false },
163 => .{ false, false, false, true }, 58 => .{ false, false, false, true },
// Tees // Tees
176 => .{ false, true, true, true }, 71 => .{ false, true, true, true },
177 => .{ true, true, false, true }, 72 => .{ true, true, false, true },
178 => .{ true, false, true, true }, 73 => .{ true, false, true, true },
179 => .{ true, true, true, false }, 74 => .{ true, true, true, false },
// Plugs // Plugs
150 => .{ false, false, true, false }, 43 => .{ false, false, true, false },
151 => .{ true, false, false, false }, 44 => .{ true, false, false, false },
152 => .{ false, false, false, true }, 45 => .{ false, false, false, true },
153 => .{ false, true, false, false }, 46 => .{ false, true, false, false },
// Closed switch // Closed switch
134 => .{ true, false, true, false }, 27 => .{ true, false, true, false },
else => .{ false, false, false, false }, else => .{ false, false, false, false },
}; };
} }
@ -82,12 +82,12 @@ const Plugs = [4]bool;
fn get_plugs(tile: u8) Plugs { fn get_plugs(tile: u8) Plugs {
return switch (tile) { return switch (tile) {
// Plugs // Plugs
150 => .{ true, false, false, false }, 43 => .{ true, false, false, false },
151 => .{ false, false, true, false }, 44 => .{ false, false, true, false },
152 => .{ false, true, false, false }, 45 => .{ false, true, false, false },
153 => .{ false, false, false, true }, 46 => .{ false, false, false, true },
// Cross // Cross
146 => .{ true, true, true, true }, 41 => .{ true, true, true, true },
else => .{ false, false, false, false }, else => .{ false, false, false, false },
}; };
} }