summary refs log tree commit diff
diff options
context:
space:
mode:
authordzwdz2022-12-10 10:57:37 +0100
committerdzwdz2022-12-10 10:57:37 +0100
commit36db7e1750f049234daf3cb228c674581d7cceb6 (patch)
tree7da640c4d63bdb657a39afd7e446abbbade72422
parentf9469968b20e597e8698fca3970dcd224fd6a38a (diff)
day 10 part 2
-rw-r--r--22.10/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/22.10/main.cpp b/22.10/main.cpp
index 4124fc7..942a19e 100644
--- a/22.10/main.cpp
+++ b/22.10/main.cpp
@@ -14,6 +14,12 @@ class VM
 			if (cycles % 40 == 20) {
 				part1 += cycles * x;
 			}
+
+			int sx = (cycles-1) % 40;
+			int sy = (cycles-1) / 40;
+			if (abs(x - sx) <= 1) cout << "\u2588";
+			else cout << ' ';
+			if (sx == 39) cout << endl;
 		}
 	}