Fork me on GitHub
#adventofcode
<
2019-12-13
>
Mario C.01:12:51

Final found the bug. My IntCode heap was being set to null

Mario C.01:12:15

surprised that didn't cause issues in part one

fellshard05:12:02

oh my gosh he's insane

😂 8
meikemertsch05:12:20

just to confirm: We start with a stackoverflowerror? or am I broken?

fellshard05:12:16

Broken, mine ran instantly in step 1

fellshard06:12:44

Well. That was weird and fun.

fellshard06:12:20

I was gonna add controls, but I discovered having a three-pixel margin of error just isn't that much fun 😛

fellshard06:12:42

Maybe if I have it only increment when you click a button instead of on every frame

misha07:12:48

got my own visualization too! kappa

"||||||||||||||||||||||||||||||||||||||
 |                                    |
 | # #     ## # ## ##  # # ##### # #  |
 | ##  #  ## ## ## #   #### #### #  # |
 |  #### ## ## ##  ## ###### ## #  #  |
 |   ##########   ##  ## #### ## ## # |
 |  ##  ##   ### # # ###   #  #  # #  |
 | #  ##   # ## #  # #### #####    #  |
 |  #   #    ####  #   ## #  ##  ## # |
 | # #    #    ## ###  ##  ##         |
 |  # ##   # ## # ### #   ##  # # ##  |
 | ###   ##   # ## ##### # ### ##   # |
 | ##  #  # # # #     # ## ##   #     |
 | ### ##   ## ## ##  #   ####  ####  |
 |   #   ## ##  # ## #  # #    #  ##  |
 |                                    |
 |                o                   |
 |                                    |
 |                                    |
 |                  -                 |
 |                                    |"

yuhan10:12:20

I wonder if it's even possible to complete Part 2 without some sort of visualization

misha10:12:24

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.

misha10:12:03

unless "arcanoid" is the first thing that comes to your mind after reading "arcade station"

fellshard19:12:16

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.

fellshard19:12:00

When he mentioned 'ball', 'paddle', and 'blocks', I knew he was referring to an arkanoid-like at least.

misha06:12:44

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

fellshard06:12:30

I've done that sometimes

fellshard06:12:47

why check carefully for halt condition when you can careen off the edge and salvage the answer on the way down?

fellshard06:12:36

It's advent of code, you're not putting it into production; messy is OK 😛

misha07:12:32

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"

dmarjenburgh13:12:07

Today is lots of fun 😄

👍 12
rjray17:12:32

This is weird. I'm still stuck on part 1, as my output is nothing but an infinite stream of 0's.

rjray17:12:49

Gotta be something wrong in my intcode machine, but it's worked for every previous day.

mpcjanssen18:12:12

@rjray i had the same. Are you sure you determine the score correctly?

rjray18:12:50

Not the score-- just running the program, the output stream is nothing but zeroes and an (apparently) infinite number of them.

mpcjanssen18:12:08

Ah misunderstood

rjray18:12:40

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.

rjray18:12:11

(For example, a series of println calls seem to be overwriting each other despite the program being single-threaded.)

rjray18:12:36

Scratch that last comment-- was confusing Clojure's join with Perl's. >_<

pastafari18:12:42

For the hull painting robot I reused the amplifier with a phase of either BLACK or WHITE 🙂

😄 4
rjray18:12:50

Ugh, I finally got debugging fixed and (naturally) immediately saw the source of my problem. So part 1 is done.

rjray18:12:27

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.?

rjray18:12:53

I mean, I'm old-enough to have played Breakout in actual arcades, but still...

rjray18:12:44

Or scoring, for that matter...

rjray18:12:41

Scratch that, I guess the scoring is just based on the output instruction.

rjray22:12:49

Yay. The game loads, initializes the screen, and immediately hits a 99 and halts.

fellshard22:12:01

Did you insert quarters?

rjray22:12:24

Yes-- I've set memory loc 0 to 2, as instructed.

fellshard22:12:39

Did you pass it an input it doesn't know how to read?

fellshard22:12:53

(I had that issue early on when I was using keyboard bindings)

rjray22:12:00

It never reads an input value, that I can tell. (I have a debug line for when input it read.)

rjray22:12:05

Let me double-check that...

rjray22:12:19

Well now. I seem to be (currently) storing input wonky. Thanks.

fellshard22:12:24

🙂 Good luck!

pastafari22:12:11

Part 1 of Day 13 was super quick. Part 2 made me 😱

pastafari22:12:21

Day 13 Part 2 -> "Beat the game by breaking all the blocks" ! Wut! I'm going to sleep on it 💤

rjray23:12:42

Fuck me. Got part 2 right on the first submission. Once I debugged and traced the holy hell out of my code, of course...

😄 12