diff options
author | dzwdz | 2022-12-10 10:57:37 +0100 |
---|---|---|
committer | dzwdz | 2022-12-10 10:57:37 +0100 |
commit | 36db7e1750f049234daf3cb228c674581d7cceb6 (patch) | |
tree | 7da640c4d63bdb657a39afd7e446abbbade72422 /22.10/main.cpp | |
parent | f9469968b20e597e8698fca3970dcd224fd6a38a (diff) |
day 10 part 2
Diffstat (limited to '22.10/main.cpp')
-rw-r--r-- | 22.10/main.cpp | 6 |
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; } } |