Final found the bug. My IntCode heap was being set to null
surprised that didn't cause issues in part one
@qythium But why do you assume that the cycle will include the first configuration?
ah, I interpreted the puzzle that way and it worked out - wonder if I just got lucky?
Also I strongly suspect the equations of motion are time-reversible, which would mean that for any configuration to repeat, all the previous steps leading up to it would also have to be repeated
oh my gosh he's insane
just to confirm: We start with a stackoverflowerror? or am I broken?
Broken, mine ran instantly in step 1
Well. That was weird and fun.
I was gonna add controls, but I discovered having a three-pixel margin of error just isn't that much fun 😛
Maybe if I have it only increment when you click a button instead of on every frame
http://quil.info/sketches/show/f35ebdfb776bb34d65a82c6d6599b4f3991d93dc80a880123f929e2cda836a64
I wonder if it's even possible to complete Part 2 without some sort of visualization
I rendered last frame of part 1, And rendered animated part 2 after completing it, for giggles. But yeah, w/o any picture I don't see how could you figure out what to do, except port or run someone else's code.
unless "arcanoid" is the first thing that comes to your mind after reading "arcade station"
It is, I retrofitted my solution to execute without viz - the paddle logic can be extremely naive, and you don't need to hold on to that much additional state. But w/o the viz you won't learn very easily how the paddle behaves.
When he mentioned 'ball', 'paddle', and 'blocks', I knew he was referring to an arkanoid-like at least.
this is how I got second star:
(#:adventofcode.2019.day05{:idx 439, :relbase 2239, :input [0], :output -1} #:adventofcode.2019.day05{:idx 441, :relbase 2239, :input [0], :output 0} #:adventofcode.2019.day05{:idx 443, :relbase 2239, :input [0], :output 10776})
Syntax error (NullPointerException) compiling at (day13.clj:91:1).
null
:d:I've done that sometimes
why check carefully for halt condition when you can careen off the edge and salvage the answer on the way down?
It's advent of code, you're not putting it into production; messy is OK 😛
this is how I feel when someone mentions "but this is universal solution", where universal means "more than 3 coordinate axes" rather "for anyone's input"
got my own visualization too! :kappa:
"||||||||||||||||||||||||||||||||||||||
| |
| # # ## # ## ## # # ##### # # |
| ## # ## ## ## # #### #### # # |
| #### ## ## ## ## ###### ## # # |
| ########## ## ## #### ## ## # |
| ## ## ### # # ### # # # # |
| # ## # ## # # #### ##### # |
| # # #### # ## # ## ## # |
| # # # ## ### ## ## |
| # ## # ## # ### # ## # # ## |
| ### ## # ## ##### # ### ## # |
| ## # # # # # # ## ## # |
| ### ## ## ## ## # #### #### |
| # ## ## # ## # # # # ## |
| |
| o |
| |
| |
| - |
| |"
you can leverage maps and vectors:
{:north [[:west [dec identity]] [:east [inc identity]]]
:south [[:east [inc identity]] [:west [dec identity]]]
:west [[:south [identity dec]] [:north [identity inc]]]
:east [[:north [identity inc]] [:south [identity dec]]]}
and then (get-in m [face turn])
😞 Thanks!
This is next level https://twitter.com/vcazacov/status/1205261123244695552?s=09
Today is lots of fun 😄
It might crash at the end, but not before it prints the score. https://gitlab.com/dmarjenburgh/adventofcode/blob/master/src/adventofcode/year_2019.clj#L317-363
This is weird. I'm still stuck on part 1, as my output is nothing but an infinite stream of 0's.
Gotta be something wrong in my intcode machine, but it's worked for every previous day.
@rjray i had the same. Are you sure you determine the score correctly?
Not the score-- just running the program, the output stream is nothing but zeroes and an (apparently) infinite number of them.
Ah misunderstood
I'm trying to debug the intcode, but having just extracted it into a separate module it's proving harder to instrument for debugging than it was before.
(For example, a series of println
calls seem to be overwriting each other despite the program being single-threaded.)
Scratch that last comment-- was confusing Clojure's join
with Perl's. >_<
For the hull painting robot I reused the amplifier with a phase of either BLACK or WHITE 🙂
Ugh, I finally got debugging fixed and (naturally) immediately saw the source of my problem. So part 1 is done.
Now I'm looking at part 2, and I'm kind of annoyed. Are we supposed to just inherently know the "rules" for how the ball moves, interacts with the paddle, etc.?
I mean, I'm old-enough to have played Breakout in actual arcades, but still...
Or scoring, for that matter...
Scratch that, I guess the scoring is just based on the output instruction.
Yay. The game loads, initializes the screen, and immediately hits a 99 and halts.
Did you insert quarters?
Yes-- I've set memory loc 0 to 2, as instructed.
Did you pass it an input it doesn't know how to read?
(I had that issue early on when I was using keyboard bindings)
It never reads an input value, that I can tell. (I have a debug line for when input it read.)
Let me double-check that...
Well now. I seem to be (currently) storing input wonky. Thanks.
🙂 Good luck!
Part 1 of Day 13 was super quick. Part 2 made me 😱
Day 13 Part 2 -> "Beat the game by breaking all the blocks" ! Wut! I'm going to sleep on it 💤
Fuck me. Got part 2 right on the first submission. Once I debugged and traced the holy hell out of my code, of course...