From 36db7e1750f049234daf3cb228c674581d7cceb6 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sat, 10 Dec 2022 10:57:37 +0100 Subject: day 10 part 2 --- 22.10/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '22.10/main.cpp') 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; } } -- cgit 1.4.1-2-gfad0