diff --git a/d10.cc b/d10.cc index d7d74e5..c39019a 100644 --- a/d10.cc +++ b/d10.cc @@ -93,18 +93,20 @@ unsigned p1(const Input &input) return sum; } +#define WIDTH 40 + void p2(const Input &input) { Cpu cpu(&input); while (cpu.running()) { // Calculate current CRT line - int X = cpu.cycle % 40; - if (X == 0) X += 40; + int X = cpu.cycle % WIDTH; + if (X == 0) X += WIDTH; // Draw pixel if (cpu.X <= X && X <= cpu.X + 2) cout << '#'; else cout << '.'; - if (X == 40) cout << endl; + if (X == WIDTH) cout << endl; cpu.tick(); } diff --git a/d10_mick.txt.xz b/d10_mick.txt.xz new file mode 100644 index 0000000..19d3a6d Binary files /dev/null and b/d10_mick.txt.xz differ