It's time to break out our IntCode interpreter and do something useful for once: play breakout.
Day 13 - The Problem
Man, flying throug...
For further actions, you may consider blocking this person and/or reporting abuse
Surprisingly simple! No modifications needed to the IntCode after the Robot problem, so just plug in the interpreter and tell it how to play the game!
Kotlin solution:
This was much easier indeed!
Part One
The only thing I've given for granted is that the machine, on the first part, never overwrites a tile, but I was ready to track that down eventually. I'm reporting just the relevant parts in JavaScript:
Part Two
I don't know if you noticed the hidden message in the text: "You do have crew quarters, but they won't fit in the machine." π
Anyway, after the initial confusion about "how to play this game?!", I realized this is just Arkanoid/Breakout! π I just have to move the paddle left and right to reach the ball.
The only change I did to the main routing was to set a fixed input value instead of a stack of values (
joystickPosition
).Get my input at my repo.
Pretty straightforward today, which was nice after yesterday's tricky part 2 that I haven't solved yet (I didn't have as much time as usual). I adapted the idea from the painting robot to screen drawing, and used a very simple input logic for part 2 to make the paddle track the ball's x coordinate.
Job done!
Clojure solution:
As always, full code: github.com/jkoenig134/AdventOfCode...
No change in OpCode computer and it runs smoothly now.
Swift solution here
Opcode can be found here in GitHub -> github.com/rizwankce/AdventOfCode/...