adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
Mario C. 2019-12-13T01:36:51.114300Z

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

Mario C. 2019-12-13T01:37:15.114700Z

surprised that didn't cause issues in part one

Average-user 2019-12-13T02:26:53.114900Z

@qythium But why do you assume that the cycle will include the first configuration?

yuhan 2019-12-13T04:28:22.115100Z

ah, I interpreted the puzzle that way and it worked out - wonder if I just got lucky?

yuhan 2019-12-13T04:32:10.115300Z

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

fellshard 2019-12-13T05:09:02.115600Z

oh my gosh he's insane

😂 2
2019-12-13T05:10:20.115900Z

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

fellshard 2019-12-13T05:37:16.116300Z

Broken, mine ran instantly in step 1

fellshard 2019-12-13T06:14:44.116800Z

Well. That was weird and fun.

fellshard 2019-12-13T06:15:20.117300Z

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

fellshard 2019-12-13T06:15:42.117800Z

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

yuhan 2019-12-13T10:08:20.123100Z

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

misha 2019-12-13T10:38:24.123400Z

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.

misha 2019-12-13T10:40:03.123600Z

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

fellshard 2019-12-13T19:38:16.011500Z

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.

fellshard 2019-12-13T19:39:00.011700Z

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

misha 2019-12-13T06:51:44.118400Z

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:

fellshard 2019-12-13T06:55:30.118700Z

I've done that sometimes

fellshard 2019-12-13T06:55:47.119200Z

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

fellshard 2019-12-13T06:56:36.119500Z

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

misha 2019-12-13T07:05:32.120800Z

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"

misha 2019-12-13T07:06:48.120900Z

got my own visualization too! :kappa:

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

misha 2019-12-13T07:14:53.121100Z

👌 1
misha 2019-12-13T07:22:49.121500Z

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]]]}

misha 2019-12-13T07:23:47.121800Z

and then (get-in m [face turn])

2019-12-13T07:26:10.122Z

😞 Thanks!

2019-12-13T08:33:59.122600Z

This is next level https://twitter.com/vcazacov/status/1205261123244695552?s=09

🤯 1
❤️ 1
😍 1
2019-12-13T13:22:07.000100Z

Today is lots of fun 😄

👍 3
2019-12-13T13:25:11.000800Z

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

rjray 2019-12-13T17:42:32.002100Z

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

rjray 2019-12-13T17:42:49.002600Z

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

mpcjanssen 2019-12-13T18:18:12.004400Z

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

rjray 2019-12-13T18:18:50.005Z

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

mpcjanssen 2019-12-13T18:19:08.005500Z

Ah misunderstood

rjray 2019-12-13T18:19:40.006100Z

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.

rjray 2019-12-13T18:24:11.007Z

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

rjray 2019-12-13T18:27:36.007500Z

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

2019-12-13T18:28:42.007900Z

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

😄 1
rjray 2019-12-13T18:50:50.008900Z

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

rjray 2019-12-13T18:52:27.010Z

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

rjray 2019-12-13T18:52:53.010600Z

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

rjray 2019-12-13T18:53:44.010800Z

Or scoring, for that matter...

rjray 2019-12-13T18:54:41.011200Z

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

rjray 2019-12-13T22:00:49.016500Z

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

fellshard 2019-12-13T22:05:01.016700Z

Did you insert quarters?

rjray 2019-12-13T22:05:24.017200Z

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

fellshard 2019-12-13T22:05:39.017500Z

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

fellshard 2019-12-13T22:05:53.018Z

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

rjray 2019-12-13T22:07:00.018700Z

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

rjray 2019-12-13T22:07:05.018900Z

Let me double-check that...

rjray 2019-12-13T22:08:19.019400Z

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

fellshard 2019-12-13T22:10:24.019800Z

🙂 Good luck!

2019-12-13T22:51:11.021300Z

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

2019-12-13T22:56:21.023200Z

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

rjray 2019-12-13T23:42:42.023900Z

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

😄 3