added day 20 part 1
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 21 Dec 2020 02:17:48 +0000 (20:17 -0600)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Mon, 21 Dec 2020 02:17:48 +0000 (20:17 -0600)
day20.onyx [new file with mode: 0644]
input/day20.txt [new file with mode: 0644]

diff --git a/day20.onyx b/day20.onyx
new file mode 100644 (file)
index 0000000..53cc834
--- /dev/null
@@ -0,0 +1,171 @@
+#include_file "core/std/wasi"
+
+use package core
+use package core.string.reader as reader
+
+TILE_DATA_WIDTH  :: 10
+TILE_DATA_HEIGHT :: 10
+
+Tile :: struct {
+       id          : u32;
+       orientation : TileOrientation;
+       data        : [] bool;
+       edges       : [] u32;
+
+       pos_x       : u32 = 0;
+       pos_y       : u32 = 0;
+    
+    edges_with_match : Sides = Sides.{};
+}
+
+Sides :: struct {
+    top    : bool = false;
+    right  : bool = false;
+    bottom : bool = false;
+    left   : bool = false;
+}
+
+TileOrientation :: enum {
+       NORMAL;                 ROTATE_90;         ROTATE_180;         ROTATE_270;
+       FLIPPED_NORMAL; FLIPPED_ROTATE_90; FLIPPED_ROTATE_180; FLIPPED_ROTATE_270;
+}
+
+// Thought about making this dynamic and really fancy...
+// and then I remembered this is advent of code so that
+// is not necessary.
+TileData :: #type [TILE_DATA_WIDTH * TILE_DATA_HEIGHT] bool;
+
+reverse_binary :: proc (n_: u32, digits := TILE_DATA_WIDTH) -> u32 {
+       res := 0;       
+       n := n_;
+       for _: 0 .. digits {
+               res <<= 1;
+               res |= (n & 1);
+               n >>= 1;
+       }
+
+       return res;
+}
+
+build_edges :: proc (tile: [] bool, a := context.allocator) -> [] u32 {
+       edges : [] u32;
+       #context_scope {
+               context.allocator = a;
+               alloc.alloc_slice(^edges, 8);
+       }
+       next_edge := 0;
+
+       for y: u32.[0, 9] {
+               edge := 0;
+
+               for x: 0 .. 10 {
+                       edge <<= 1;
+                       if tile[x + y * TILE_DATA_WIDTH] do edge |= 1;
+               }
+
+               edges[next_edge] = edge;
+               next_edge += 1;
+       }       
+
+       for x: u32.[0, 9] {
+               edge := 0;
+
+               for y: 0 .. 10 {
+                       edge <<= 1;
+                       if tile[x + y * TILE_DATA_WIDTH] do edge |= 1;
+               }
+
+               edges[next_edge] = edge;
+               next_edge += 1;
+       }       
+
+       for i: 0 .. 4 {
+               edges[next_edge] = reverse_binary(edges[i]);
+               next_edge += 1;
+       }
+
+       return edges;
+}
+
+has_matching_edges :: proc (t1: ^Tile, t2: ^Tile) -> bool {
+    match := false;
+
+       for e_idx: 0 .. t1.edges.count / 2 do for e2: t2.edges {
+        if t1.edges[e_idx] == e2 {
+            match = true;
+
+            switch e_idx {
+                case 0 do t1.edges_with_match.top = true;
+                case 1 do t1.edges_with_match.right = true;
+                case 2 do t1.edges_with_match.bottom = true;
+                case 3 do t1.edges_with_match.left = true;
+            }
+        }
+    }
+
+       return match;
+}
+
+main :: proc (args: [] cstr) {
+       contents := file.get_contents("input/day20.txt");
+
+       file := reader.make(contents);  
+
+       tiles : [..] Tile;
+       array.init(^tiles);
+       defer array.free(^tiles);
+
+       tile_data := calloc(200 * sizeof TileData);
+       defer cfree(tile_data);
+       
+       tile_data_arena := alloc.arena.make(tile_data, 200 * sizeof TileData);
+       tile_allocator  := alloc.arena.make_allocator(^tile_data_arena);
+
+       while !reader.empty(^file) {
+               reader.read_word(^file); // 'Tile '
+               id := reader.read_u32(^file);
+
+               reader.advance_line(^file);
+
+               td := cast(^bool) raw_alloc(tile_allocator, sizeof TileData);
+
+               for y: 0 .. 10 {
+                       line := reader.read_line(^file);
+
+                       for x: 0 .. 10 {
+                               td[x + y * TILE_DATA_WIDTH] = (line[x] == #char "#");
+                       }
+               }
+
+               tile_data := td[0 .. TILE_DATA_HEIGHT * TILE_DATA_WIDTH];
+               edges := build_edges(tile_data, tile_allocator);
+
+               array.push(^tiles, Tile.{
+                       id = id,
+                       orientation = TileOrientation.NORMAL,
+                       data = tile_data,
+                       edges = edges,
+               });
+
+               reader.advance_line(^file);
+       }
+
+       prod: u64 = 1;
+
+       for i: 0 .. tiles.count - 1 {
+               matching_count := 0;
+
+               for j: 0 .. tiles.count {
+                       if i == j do continue;
+                       if has_matching_edges(^tiles[i], ^tiles[j]) {
+                               matching_count += 1;
+                       }
+               }
+
+               if matching_count == 2 {
+                       prod *= ~~tiles[i].id;
+        }
+       }
+
+       printf("Corner product: %l\n", prod);
+}
diff --git a/input/day20.txt b/input/day20.txt
new file mode 100644 (file)
index 0000000..273b146
--- /dev/null
@@ -0,0 +1,1727 @@
+Tile 3583:
+.##..#..#.
+....##....
+##..#..#..
+.....#....
+.#..#.....
+#.#.......
+#.....#..#
+....#....#
+...#.##.#.
+.#....##.#
+
+Tile 3967:
+..###..#..
+#.........
+.........#
+#...#....#
+....#....#
+#...#....#
+#..#...#.#
+##....##..
+#....#....
+##.###.#..
+
+Tile 3307:
+.#.#...#..
+......#..#
+.........#
+##.....##.
+..#.....#.
+.#...####.
+#....#.#.#
+......##.#
+#.##.#..##
+.....#.##.
+
+Tile 1741:
+.##..#.#..
+#..##.#...
+.#.....#..
+...####.##
+#.#..###..
+####.#....
+..#.##.#..
+#.....#.#.
+#.###.....
+####...###
+
+Tile 3821:
+.#######.#
+...#......
+#.##.#...#
+.#...#####
+....#.##..
+#.#.#.....
+##......##
+#..#.....#
+##..#..#.#
+###..#.#..
+
+Tile 1787:
+..##.#.###
+...##..#.#
+#..#.###.#
+..#.##..#.
+#.#.....##
+...#...#.#
+#..##..#.#
+##.#.##..#
+...#..#...
+..#..##...
+
+Tile 2281:
+..#.#.##.#
+.......##.
+..#..#..#.
+....#.#..#
+#...#.##.#
+#..#.##.#.
+#.#....#.#
+#....##...
+.....#..##
+...#.#...#
+
+Tile 3593:
+...#..#..#
+.........#
+.........#
+#.#..#...#
+##......##
+##........
+...#.#...#
+#...#...##
+...#.#.#..
+#..#......
+
+Tile 3259:
+.####.....
+....#.#.##
+#....#..##
+#........#
+.....#....
+.#.....#.#
+...##....#
+#.....#.#.
+#.#..#....
+#.#..##.#.
+
+Tile 2663:
+.####..###
+#.#..##...
+#..#...#..
+#..#....#.
+..#.##...#
+.#....#.#.
+#..#....#.
+#.#.......
+.#.#......
+..#..#####
+
+Tile 3833:
+####....#.
+.......#.#
+.#........
+#...#.##.#
+#.##.#.#.#
+...#.....#
+##...#...#
+#.#.##...#
+##.#.#.##.
+.##.###.##
+
+Tile 3373:
+#.....##.#
+#...###..#
+..#.#..#..
+####..#.##
+#...#.##.#
+#..##.#...
+#..##...##
+#.####....
+##..#...#.
+##.##.#.##
+
+Tile 1511:
+.#.###...#
+#....#...#
+.##.#.....
+...##.###.
+#.##.##..#
+####.#..##
+#..#.#....
+#.......#.
+#......#.#
+###...#...
+
+Tile 1723:
+...##..#.#
+..#..#...#
+.##.....#.
+#..#......
+.#..#.#..#
+.#........
+...#.#..##
+##.......#
+..#..###..
+#####...##
+
+Tile 1543:
+#..#.##.##
+#.....#..#
+.....#.#.#
+###.......
+...##....#
+..#..#...#
+#.....##.#
+#.#..##.##
+...###....
+###.#...#.
+
+Tile 1433:
+##.##..##.
+###....#.#
+..#.....##
+.#.##..#..
+.#.#...###
+#.#.....#.
+..##.....#
+#....#....
+..#.#...#.
+.#...#####
+
+Tile 1949:
+#.#..##..#
+.........#
+.#.......#
+#..##..###
+........##
+#........#
+.....#...#
+...####.#.
+.#...##...
+###.#.#..#
+
+Tile 3889:
+###...####
+#....##..#
+.#.###...#
+##..#.....
+.....#....
+....#.#.#.
+.........#
+#....##..#
+##.##..##.
+#.###.####
+
+Tile 2477:
+.....#..##
+#.##.###..
+###..#...#
+.#....#.#.
+#..#......
+...#.....#
+##.....#..
+..##.....#
+.##.#....#
+#####.####
+
+Tile 2137:
+..########
+#..#......
+...#.##..#
+#.#..#...#
+.#..#...##
+##.....#.#
+.#....##..
+.##.......
+.#..####..
+#..###...#
+
+Tile 3313:
+..####.#.#
+#..#.....#
+#....#....
+..##..##..
+#....##...
+..........
+#.........
+.......###
+##........
+.###...###
+
+Tile 1493:
+#..####.##
+##.#..#...
+#.#.....##
+.##......#
+.##...#..#
+#..##....#
+#.#.#.#.#.
+#.#...#..#
+#.#.#....#
+#.####...#
+
+Tile 1579:
+.##..##.##
+#.#.......
+.......#..
+..#...##..
+#..####...
+.#.#.##.##
+###.#.....
+#....##.##
+....#...##
+##....#.#.
+
+Tile 2221:
+.#.#......
+.......##.
+#..#.#...#
+..###.###.
+....#...##
+##.#..##..
+..##.#.#..
+......####
+..##.#.#..
+.###..#.##
+
+Tile 3643:
+..###...#.
+#..#..#..#
+.##.......
+#..###....
+##...##.##
+#...#...#.
+###......#
+....#..#.#
+.#.#.....#
+..#..#.#..
+
+Tile 3881:
+###.##.##.
+.####..###
+#.###..##.
+....#...#.
+##...#..#.
+#........#
+....#...#.
+...#.....#
+.#.....##.
+.####..#.#
+
+Tile 3823:
+..#.##..##
+#...#....#
+..#...#...
+#.#.##...#
+.####....#
+.#...#...#
+..........
+.........#
+...#..#...
+....#..#.#
+
+Tile 3181:
+####..##.#
+#.....##.#
+#.......##
+.......#.#
+..#..##.#.
+##..#..#..
+...##.....
+.........#
+....#.##..
+.##.###.#.
+
+Tile 2837:
+.###.#.###
+#.##..#.##
+.....##...
+###......#
+##.......#
+........##
+##.##..#..
+....###...
+..........
+#......#.#
+
+Tile 2063:
+..#####...
+..........
+........#.
+..##.....#
+###...#.#.
+#.#.....#.
+.....#..##
+#.......#.
+##....##..
+#.##.###.#
+
+Tile 1187:
+#...##..##
+#........#
+#.#.......
+...#.#....
+.....#.#.#
+#....#....
+..###.....
+.#........
+..#...###.
+####.#.#.#
+
+Tile 3137:
+...###..#.
+#.##.....#
+..#...#..#
+#..#.....#
+......#...
+#.....##.#
+...#......
+#.#.#.####
+..#....#..
+.#..#.#.##
+
+Tile 2411:
+#.....##..
+.......#.#
+.....##...
+#.#.......
+#..##....#
+.##.##....
+.##...##..
+#.#.......
+##.....#.#
+.##.###...
+
+Tile 2713:
+..#.#.####
+...####.#.
+##..#...#.
+#..##.....
+#...#.....
+.#...#.###
+..........
+#.#.##..#.
+#.#..#..#.
+.#..##.#.#
+
+Tile 1103:
+##.#...##.
+#.....##..
+...###..#.
+..##.....#
+.####..#..
+..#.###.#.
+##.....#..
+.#..#....#
+#........#
+####...##.
+
+Tile 3943:
+.###......
+#...#.#...
+..##..#..#
+.##..#.#.#
+..........
+##...#....
+#..#...#..
+#..###...#
+###....###
+#.#....###
+
+Tile 1871:
+##.#...##.
+#......#..
+.#.##.....
+.#####.#..
+#.#....#..
+#..#....##
+#..####.#.
+#....#....
+...#.....#
+...#.##.#.
+
+Tile 3407:
+#.#.#####.
+##.#..#..#
+.###.#.#.#
+..#.......
+##.###.#..
+.....#.###
+#.#.......
+##..#.#..#
+#.#.##.#.#
+#..#..###.
+
+Tile 2441:
+#####.#..#
+...#.#....
+..#...#..#
+.##....#..
+#.##..#...
+.##.#..#.#
+##.......#
+.##..#....
+.......#..
+.#..#.###.
+
+Tile 3637:
+.#..##.#.#
+...##..#..
+#.#.###...
+#....#...#
+..#.....##
+#....#...#
+#..#.#.#..
+....#..#.#
+....#.#..#
+.#.###.##.
+
+Tile 1549:
+....##.##.
+.#....#...
+..####.#..
+....#.#..#
+#........#
+..#.......
+.#.#....##
+...######.
+#...##....
+.#...##...
+
+Tile 1481:
+...##.##..
+#...#.##..
+#..#..#.#.
+#.#.#...#.
+#...#.##..
+.##....#..
+#........#
+....#.#...
+#.#.....##
+#.....####
+
+Tile 1559:
+#..#....#.
+..#.##.#.#
+#.....#.##
+.###.#...#
+..####..##
+#..#.#..#.
+#.#...###.
+#.....#.#.
+.#.....#..
+#..####.#.
+
+Tile 2251:
+#..#.....#
+.#..#.....
+#.#....#..
+#....##..#
+##....#..#
+..#..#....
+#.#.#.#...
+#...#....#
+###..#.##.
+##..#.####
+
+Tile 2897:
+...###....
+##..#....#
+.........#
+.#.......#
+...#.....#
+..#..#...#
+.#...#...#
+#....#....
+.#......##
+..##...##.
+
+Tile 2239:
+#..###..#.
+.#.......#
+.#..#..#..
+#.##....##
+#....#.#.#
+##..#.....
+#........#
+...##.#..#
+#...###..#
+...#.#.###
+
+Tile 2593:
+.#....##.#
+##......##
+..#..##...
+.#..#.....
+...#.#...#
+#.#..#.#..
+......#.#.
+#...##...#
+###..##..#
+#.#####.##
+
+Tile 3697:
+##.######.
+###....#..
+#.....##.#
+##...#..##
+#.....#..#
+.#.#..#...
+#......##.
+#.#.#.#.#.
+.........#
+....####..
+
+Tile 3739:
+##.#......
+.#.....#.#
+..#.....##
+#....##...
+##.#...#..
+###.#...##
+.#...#.###
+.#..#.##.#
+..#..#..#.
+...#.##...
+
+Tile 2459:
+.#.####...
+#..#...#..
+.....#.##.
+..#....##.
+#......##.
+##...#..##
+#....#....
+###...#..#
+###.##.###
+.....##...
+
+Tile 2939:
+##.#.#....
+#..#.#####
+#...###.#.
+..#...#.##
+.#.....##.
+###....#..
+.##...#..#
+.....#.#..
+..#..#....
+..##..#.##
+
+Tile 2347:
+.###..#..#
+##......#.
+#......#..
+#...#....#
+#......#..
+##.......#
+..#.......
+#.##..#...
+#..#..###.
+#....##..#
+
+Tile 2381:
+######....
+##.......#
+.#....###.
+#.##.##.#.
+#.#..#....
+.........#
+....#..#.#
+#####.....
+..##....##
+#..###...#
+
+Tile 2503:
+#.#...###.
+#...#..#..
+.##.#.#.##
+.#.....#..
+#...##....
+##.#.....#
+...#..#..#
+..#.##...#
+......#...
+##..#..##.
+
+Tile 3023:
+.#...#....
+#.##...#..
+##....#...
+.#..#.....
+.#.#.....#
+#.#.......
+##..#.#.#.
+#...#.#...
+...#..#.##
+#...##.###
+
+Tile 3851:
+#..##.#.#.
+#...#....#
+###..#....
+#.#.#...##
+..#.#..#.#
+#.......#.
+..#.....##
+..........
+#.#.#.#..#
+..#.##..#.
+
+Tile 1009:
+.####.##..
+#.........
+.#.#......
+..#.#.....
+#......##.
+###.......
+#.#.......
+.......#.#
+.#....#.##
+#.####.#.#
+
+Tile 1151:
+.#.##..#..
+..#......#
+##....##.#
+#......###
+##.....#..
+##..#.#..#
+...#......
+.##...##..
+##..###..#
+######.###
+
+Tile 2683:
+#..#.#..##
+.#....#.#.
+#...##....
+....###...
+...#..#...
+..#.......
+...#...#..
+....#.#...
+..#..#...#
+..#.#.##..
+
+Tile 3323:
+#.#..##.##
+#.#....###
+#.##.###.#
+##....#...
+##..#.....
+###.#.#.##
+#......#.#
+..#....##.
+#......#.#
+.##...#..#
+
+Tile 2333:
+##.#..#..#
+#..##.....
+.........#
+.#.#.#....
+#...##...#
+#.#.#....#
+..#.###..#
+....###.#.
+#...#....#
+..#.....#.
+
+Tile 2543:
+#..###.#..
+....#..#.#
+..#...#.#.
+#...##...#
+.#.....###
+..........
+#..#....#.
+#....#..#.
+#.#..##..#
+##...#..##
+
+Tile 1483:
+###..##..#
+.#......#.
+.......#.#
+#........#
+...#...#.#
+#.#.#.....
+#......#.#
+#...#.#...
+#...####..
+#.##..#..#
+
+Tile 2027:
+.#..#....#
+....##....
+....#...##
+#.#..#....
+#.#.....##
+.......#.#
+#...#.....
+.##....#.#
+###.#.##.#
+.###.#.###
+
+Tile 1699:
+#.###..##.
+..#.###...
+.........#
+.#.#..#..#
+...##.##..
+#........#
+.......#.#
+##..#...##
+.....#....
+#########.
+
+Tile 2843:
+#...#.####
+....#.##..
+...#....#.
+.....#....
+#..##.....
+.....#....
+###.#.....
+......#..#
+#.#.#...##
+#...##.##.
+
+Tile 1597:
+#..#######
+..........
+.#........
+#..##.#...
+##.....#..
+##.###...#
+.....###.#
+...##.#..#
+#....#...#
+##.#.#####
+
+Tile 2311:
+.#.#.#.###
+.#.......#
+..#...#.##
+#..#....##
+#...#.....
+.........#
+.#.#...##.
+.#.##....#
+..#..#...#
+...##.#.#.
+
+Tile 1889:
+#.###.###.
+.#...#...#
+#........#
+#......#.#
+..#......#
+#......###
+.....#.##.
+#.....#..#
+........##
+####...#.#
+
+Tile 3581:
+........##
+.#...#...#
+###.....#.
+..........
+#.#......#
+......#..#
+##........
+..#...####
+#..#......
+.##.###.##
+
+Tile 1499:
+##.#.#....
+.##...##..
+##.....##.
+###.#...##
+..##....#.
+.#....#...
+#..#...##.
+..#....##.
+.#.....#..
+..#.####.#
+
+Tile 2999:
+.#.###..#.
+#.#...#...
+##.#......
+...#..#...
+..###..###
+...#.#..#.
+#..##.#..#
+.........#
+..#....##.
+..#.###.#.
+
+Tile 1487:
+#....#....
+.#.....#..
+.#.#.....#
+#.#......#
+#.#.##....
+#.....#...
+.....#....
+##........
+##..##...#
+#.#..#...#
+
+Tile 2969:
+#..#.#..##
+###..#...#
+.#..#.....
+...####.#.
+#.#.##..#.
+...###...#
+#...#.....
+..#...##..
+##..#.#..#
+#..#.###.#
+
+Tile 1873:
+..###.#.#.
+..#.###.#.
+#.#.##...#
+.#...#...#
+....#.....
+##.....##.
+.....#.#..
+..#..#..#.
+..##..#..#
+##...#....
+
+Tile 2029:
+#.#...####
+#....##...
+.#.#...##.
+#####.#.#.
+#..#......
+#...#..#..
+#.#.#..#.#
+#......#.#
+...####.#.
+..##.#.###
+
+Tile 3517:
+.##...##..
+.#......#.
+....##....
+#.##..#..#
+.......##.
+#..#......
+...##...#.
+........##
+#...#....#
+..######.#
+
+Tile 2803:
+#.##.###..
+.#..##...#
+...##.....
+.#.#.#.#..
+#.......#.
+.##.#.#..#
+.#.###.#..
+.#..#...##
+#...###...
+.###..#.##
+
+Tile 1237:
+.######.##
+#.#.......
+....#....#
+.....#...#
+#.###.#.##
+#...####..
+#.#......#
+#.#.##.#.#
+#..#..#...
+.#..#....#
+
+Tile 3877:
+..#.#.#.##
+..##...#..
+#..#...#..
+#.......#.
+#.......#.
+#...#.##..
+.#.......#
+....#..###
+##.......#
+.#.##.#.#.
+
+Tile 2081:
+####.#####
+....#..##.
+........##
+....#..##.
+#..#....#.
+.##...##..
+......#...
+.#....#..#
+#.#.#...##
+.##...##.#
+
+Tile 2789:
+.#.##..#.#
+.......#..
+##.......#
+..#..#..##
+..#.......
+.#........
+#..##.#.#.
+###.#..###
+##..#...##
+..#..#....
+
+Tile 3989:
+##.##...##
+#....#..#.
+.#....#.##
+#......#.#
+#.#..#....
+#....#.#.#
+...#...#..
+#........#
+.......#.#
+##.##.##..
+
+Tile 1933:
+.....###.#
+#...#.#..#
+.#....#..#
+.#........
+#####.##..
+#..#.#...#
+#..#.#...#
+....##....
+#....#..#.
+##..#..##.
+
+Tile 1601:
+##.#..##..
+.#.###.#.#
+..#.###..#
+##.#.#....
+.....###.#
+##.##.####
+#.#...#..#
+#...##....
+...#......
+.####..###
+
+Tile 1117:
+#..##..##.
+......##.#
+....##.#..
+#....#....
+.#.#.....#
+.....#.##.
+#....##...
+#.....#...
+..#..##.#.
+.#.###.#..
+
+Tile 1409:
+#...###...
+#......#..
+........#.
+.#........
+##....#...
+#.......##
+#......#..
+......##.#
+#..###.#..
+.####.##..
+
+Tile 3359:
+##.##....#
+#..#...#.#
+#....#####
+...##..#..
+..#..#...#
+........##
+...#...#.#
+.........#
+...#.#.#.#
+##.#....##
+
+Tile 2539:
+...##.##.#
+#.##.#...#
+...##.#...
+..#.#..#..
+#.#..#.###
+......##.#
+#.......#.
+.#.......#
+#...####..
+..#...###.
+
+Tile 1607:
+##..###.#.
+#...#....#
+#.#.#..#..
+#..#....##
+#.#......#
+....##....
+#..###...#
+..#.##..##
+##....##.#
+...##..###
+
+Tile 2971:
+#....#..##
+.##......#
+#..##.....
+#...##.##.
+#...#.##..
+....##...#
+..#.###...
+##.#.#..##
+#..#..###.
+#...###.##
+
+Tile 2447:
+#..#..##.#
+#....##..#
+.....##...
+..#.###..#
+#..#.##...
+#.#.#...##
+#.#..###.#
+####..#...
+#.#...###.
+#..###..##
+
+Tile 1709:
+.....#..##
+##....#...
+.........#
+...###..#.
+###......#
+..#..#...#
+#.###.#..#
+###....##.
+...#..##.#
+##.#...#..
+
+Tile 3109:
+.#..###.##
+....#.#.##
+..#...#..#
+#...#.....
+####.#....
+.#.#...###
+###....#..
+#..###....
+..........
+##.##...##
+
+Tile 2089:
+..####..#.
+.###.....#
+....#..###
+.#.......#
+..##.....#
+#.###....#
+#.#.##.#.#
+#.......#.
+...#.##.#.
+...#..#.##
+
+Tile 1619:
+#...#.#.#.
+#.........
+#....##.##
+##....#...
+#####.....
+##.#..#..#
+###...#..#
+...#......
+##..#....#
+.##.##...#
+
+Tile 3319:
+###.#.#.#.
+.#....#..#
+#.#.#...##
+...#.....#
+..........
+........#.
+..........
+...#.##..#
+#.#.#....#
+##......#.
+
+Tile 1621:
+#.###.###.
+.#...#...#
+#.#......#
+#....#....
+#..#.....#
+##..#..#..
+.###..#.#.
+#.#.#.####
+#.......##
+##.##...#.
+
+Tile 2857:
+##.#.#.#..
+...#...##.
+#......#..
+......#...
+.#.#..#...
+.##..#...#
+..###....#
+#.##......
+#.###...##
+..#..##.#.
+
+Tile 2143:
+#.#.......
+#...#.##..
+#..#.....#
+...#.....#
+#...#....#
+........##
+##....#.##
+##..##..#.
+#..#.....#
+#..##....#
+
+Tile 3037:
+........##
+#....#..#.
+......#...
+....#.#...
+...###.###
+...###...#
+..........
+#.....#..#
+##..#.....
+#....#....
+
+Tile 1733:
+#.#..#.#..
+.#....##..
+#..#.#...#
+........#.
+.........#
+##....#...
+#.....#..#
+#..####.#.
+#...##....
+..#....##.
+
+Tile 2657:
+.##...#..#
+#...#.##..
+##........
+.##......#
+.#...#...#
+..##...#..
+.........#
+....#...#.
+..#.##...#
+#..######.
+
+Tile 1451:
+#.....#..#
+.....#.##.
+......##..
+..#.......
+..........
+#..##....#
+###......#
+##.#.....#
+#...##.###
+###.#.....
+
+Tile 3191:
+####.#.#.#
+.........#
+###.#####.
+#.....##..
+...#....#.
+##..#....#
+.#..#.#..#
+#........#
+######..#.
+.####.####
+
+Tile 3163:
+.#.##.#..#
+##.##.#.#.
+##..#....#
+.#....#.#.
+##.#.....#
+.#........
+#.#......#
+#.......##
+#........#
+###...###.
+
+Tile 3067:
+.#...##...
+..###.....
+##.#..#..#
+##.##..#..
+.......#..
+#...##.#..
+####....#.
+#.#....#..
+........#.
+.##.#....#
+
+Tile 3203:
+##...#.#.#
+.##..#####
+#.......##
+.#....#...
+.#....#..#
+..#.#....#
+#....#.#..
+#....#####
+#...####..
+....##.###
+
+Tile 3229:
+...#......
+#...#.....
+..##.#.##.
+#.#...#...
+#.##.#..##
+##....##..
+..#.###..#
+.....#...#
+...#.....#
+..#.#.....
+
+Tile 2083:
+....#.###.
+..........
+.........#
+...##..#.#
+.##..#....
+#..#..#...
+......#.#.
+#........#
+#.##......
+###..#.###
+
+Tile 3253:
+.##..#.#..
+.#.#...#.#
+#.#....#..
+...#.....#
+#.........
+#.........
+.##......#
+......###.
+#.........
+.....#...#
+
+Tile 1381:
+###...##.#
+#.#####.#.
+###..#..##
+#.........
+..#..#...#
+..#.#...##
+.#.#.....#
+..#...##.#
+##.#..#..#
+######....
+
+Tile 2113:
+.....##..#
+.....###..
+...#.....#
+##.#..#...
+....#.....
+...#......
+#..###.#.#
+..........
+#.#.......
+..#..#.#..
+
+Tile 1087:
+###..#.##.
+#....#....
+..#......#
+###.#....#
+.#.......#
+..#....##.
+#...#....#
+....#...##
+....#.#.#.
+#.#..#.###
+
+Tile 2833:
+.....#...#
+#...#.#.#.
+#.......#.
+#......#.#
+.#.##.#...
+........##
+....#.#.##
+........##
+......#.#.
+######.#..
+
+Tile 1063:
+.....###.#
+#####.#..#
+..###....#
+...#.##...
+###....#.#
+.....##...
+####.....#
+..##.#....
+#...#...#.
+...##.###.
+
+Tile 3049:
+#.#.#..###
+...##....#
+#..#..#.#.
+##.##..#..
+###.....##
+#.#..#.#..
+#..##....#
+#.#...#..#
+##..#..#.#
+....#####.
+
+Tile 1657:
+#..####...
+........##
+.........#
+#...#.#...
+#.#......#
+.#.#....#.
+#....###.#
+#..####.#.
+#..#..####
+...###..#.
+
+Tile 3863:
+##.#######
+..#.#.#...
+#....#..#.
+........##
+#.##......
+....#.....
+#.#..##...
+#.#......#
+..#..#.#..
+##.####..#
+
+Tile 3083:
+##.#...###
+.#..#..#..
+#.#####...
+#..#.#....
+##.....#..
+#..##..###
+.#.#.....#
+#.#..#..##
+.#.#..#.##
+...#......
+
+Tile 3853:
+#.###..###
+##..#..##.
+.....##.##
+......#..#
+...#.#..#.
+###....#..
+##.....#..
+##........
+...#..#..#
+###.###..#
+
+Tile 2129:
+..#....#.#
+#...#.....
+##...##..#
+#.#.......
+....#.....
+##......##
+#..#......
+#..#..#...
+..........
+...#.#.#..
+
+Tile 1759:
+..##..###.
+.......#..
+.#.#.....#
+.....#....
+#......#.#
+#.#......#
+#..#.#.#.#
+#..#.#...#
+#.#...#..#
+.##....#.#
+
+Tile 3617:
+..#.#..###
+..###....#
+##.#.....#
+#.##....##
+.....#..#.
+.........#
+..........
+.####..#.#
+#.#...#.#.
+....##.##.
+
+Tile 2017:
+..#.##.#.#
+....#...##
+..........
+.#........
+#.....#...
+#.....#...
+#.........
+....#.#.#.
+..#.......
+..#...#.##
+
+Tile 1277:
+..##...#.#
+.##..#..#.
+.#....##.#
+#....##...
+#..#.##..#
+###..##..#
+.........#
+.##.#.....
+..#.......
+##.###.#..
+
+Tile 2617:
+###.......
+......#...
+##.##..#..
+#.#....#..
+.###....##
+..###..#.#
+##...##..#
+#..#......
+#..#..####
+#.##..#...
+
+Tile 2719:
+..#.#.##.#
+........##
+...#.#....
+...##....#
+.#.##.#...
+..#.##.###
+##.#.....#
+.........#
+..#.#...##
+###.#..###
+
+Tile 3671:
+#..##..###
+#...#...##
+..........
+...##.....
+.#..#.#..#
+#.#..#....
+#..###.###
+..##..####
+#.........
+.#..#.#..#
+
+Tile 3389:
+.#....#.##
+.#..##.#.#
+#...##....
+##....#..#
+##......##
+.#...#....
+..#....#..
+....##....
+#.#...#.#.
+#.#.#..###
+
+Tile 3457:
+.#########
+#..#......
+..##......
+#.........
+.#...#....
+.###.....#
+.......#.#
+.........#
+###....#..
+#.......##
+
+Tile 1777:
+###.#.####
+#..#...###
+.#.#..#..#
+.......#..
+#.#..##.##
+..###.....
+###......#
+.#........
+#.####....
+##..######
+
+Tile 3613:
+####.#...#
+##.......#
+.......##.
+#....#...#
+......##.#
+...#.#..##
+#......#..
+...#...#..
+.##..##...
+.#...#..#.
+
+Tile 3529:
+.#.##.#...
+##.....#.#
+#...#..#..
+......##.#
+##..#.##.#
+##........
+#.....#...
+...#...#..
+...##.#...
+..###.....
+
+Tile 1153:
+##.##.##..
+..#####..#
+##...#..#.
+.......###
+.#.......#
+..#.#.....
+.......#.#
+#...#..###
+.....#.#..
+.#.##....#
+
+Tile 2467:
+####....##
+#..###...#
+#####....#
+.#......#.
+###.......
+##.......#
+.##.#.#..#
+....#.#...
+#........#
+.#..#.####
+
+Tile 3947:
+#.##.##.#.
+##.......#
+......#..#
+#...#..###
+.....#.###
+##..#..#..
+...#.#...#
+#...#....#
+.......#.#
+#...#..#.#
+
+Tile 1399:
+.##.#..###
+#.......#.
+#.......#.
+.....#..#.
+#........#
+##..#..#.#
+.##..##..#
+#..#......
+#.....#..#
+#.##..##..
+
+Tile 2879:
+....###..#
+..#.......
+#...#.....
+...#.#....
+.........#
+.##..#.##.
+.#...###.#
+.#.....#.#
+..##.....#
+##...#.#..
+
+Tile 1039:
+#......#.#
+##.##.###.
+.....##..#
+#........#
+..#.......
+#.........
+.#..#.#.#.
+.....###..
+#....#####
+.#.....###
+
+Tile 2777:
+#..##...#.
+....#....#
+........#.
+##.#....#.
+..#.##...#
+.#....#.#.
+#....#....
+#..#.#...#
+#...##.#.#
+#.......#.
+
+Tile 1097:
+##...###..
+..#..####.
+##....#.##
+#.....##..
+...#....##
+.##..#....
+#.##..###.
+##...#....
+#.###....#
+.#.#.###..
+
+Tile 3793:
+####.....#
+..........
+.#.##.#...
+....#....#
+#.....#...
+..###..##.
+##..#.#...
+##........
+#........#
+.###......
+
+Tile 2689:
+####...#..
+..##....##
+#.#....#.#
+.....##..#
+#.......##
+#.........
+#.....#..#
+##........
+.......#.#
+#.###..#.#