From f41564d8f1d0d0641de54621c83ef973ce2c0c5b Mon Sep 17 00:00:00 2001 From: Dory Date: Mon, 16 Dec 2024 11:07:30 -0800 Subject: [PATCH] more debugging printouts --- day15/d15p1.swift | 17 ++++++++--------- day15/d15p2.swift | 14 +++++++++----- day16/d16p1.swift | 4 ++-- day16/d16p2.swift | 1 + 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/day15/d15p1.swift b/day15/d15p1.swift index aff907e..a3604a6 100644 --- a/day15/d15p1.swift +++ b/day15/d15p1.swift @@ -35,10 +35,13 @@ struct Map: CustomStringConvertible { var s: [[String]] = Array( repeating: Array(repeating: " ", count: w*2), count: h ) - walls.forEach { w in s[w.y][w.x] = "██" } - boxes.forEach { b in s[b.y][b.x] = "▒▒" } - s[bot.y][bot.x] = "🯅🯅" - return s.map { row in row.joined() }.joined(separator: "\n") + walls.forEach { w in s[w.y][w.x] = "🮘🮘" } + boxes.forEach { b in s[b.y][b.x] = "🬴🬸" } + s[bot.y][bot.x] = "\u{001B}[91m🮿 \u{001B}[0m" + return (" " + (0.. (Map, [Move]) { } var (map, moves) = try readInput(CommandLine.arguments[1]) -print(map) print(moves) for move in moves { + //print(map) map.move(move) + //print(move) } print(map) print(map.gps) diff --git a/day16/d16p1.swift b/day16/d16p1.swift index b381b74..48b5fd8 100644 --- a/day16/d16p1.swift +++ b/day16/d16p1.swift @@ -58,8 +58,8 @@ struct Maze : CustomStringConvertible { let s: [[String]] = walls.enumerated().map { i, r in [String(format: "%3d ", i)] + r.map { $0 ? "██" : " " } } - print(" " + (0..