Fork me on GitHub
#adventofcode
<
2018-12-16
>
misha01:12:14

dude, 2015 molecules are awful, but interesting! but today's one is just zzz

misha01:12:25

GC overhead limit exceeded

fellshard02:12:24

This feels like a day 24 one in previous years, but day 15? yikes

fellshard02:12:34

Maybe the assumption is that the weekend is a good time for a big one

lucaspolymeris02:12:24

I might do day 15, but if there is other problem like this one this year I may quit the whole thing

potetm02:12:50

same^ — or at the very least skip it

markw02:12:47

this is by far the most difficult year… at least for me

markw02:12:44

I think it’s a combination of just more difficult puzzles, but also I’ve noticed that compared to prior years where part 2 is usually a layup, this year that is not always the case

misha03:12:45

(assert (= (f1 input) 196200))
"Elapsed time: 4399.123038 msecs"

misha03:12:49

p2? I'll just let it run overnight and submit result. totally not worth it, although I have an optimization in mind.

misha03:12:44

p2 "Elapsed time: 538665.073576 msecs"

me174003:12:34

Day 15: https://github.com/benfle/advent-of-code-2018/blob/master/day15.clj I am not sure why my Part Two does not work. Probably something stupid because it worked on all the examples.

me174003:12:22

Functional programming is not the best for simulations 🙂

misha03:12:53

@lucaspolymeris 15

fellshard04:12:31

Okay, not deleting this time. data.priority-map is definitely busted 😞

fellshard04:12:12

Specifically, it really seems to behave oddly with the way I'm using it, and I'm not sure what about my keys and values is causing pop / dissoc to break

ben.grabow04:12:05

@fellshard Can you use sorted-set-by instead, where the set contents are the items and the sort fn is the item->priority fn?

fellshard04:12:31

Looks like I'll have to. Was trying to avoid resorting each time 😞

fellshard04:12:08

Going for a classic priority queue sorted-heap approach, but that doesn't seem to be something anyone has implemented reliably in Clojure, at least not with any of those key words.

fellshard04:12:25

Maybe an issue in getting a persistent impl? Dunno.

norman06:12:00

I guess day 15 really took a toll on people.

norman07:12:01

Well, hope to see some renewed activity here for day17.

fellshard08:12:35

I jumped ship to 16, that was much more fun 🙂

fellshard08:12:18

Maybe I'll see about continuing 15 tomorrow, my brain's happily fried. The wrinkle in this problem was a fun one to figure out, it took me a few attempts to find a working algorithm.

markw08:12:53

16 wasn’t too bad… but I took the lazy way out on part two and just one by one eliminated anything that didn’t have a unique result

markw08:12:56

manually that is… maybe tomorrow i’ll code it.. i always feel dirty/guilty doing it by hand

namenu08:12:01

@markw same here 😅 I'm thinking of it to solve with core.logic later.

regen17:12:51

i gave core.logic a try with solving day 7, but I don't think it was much improvement. (and I still couldn't figure out how to get the ordered steps without using elimination with everyg) https://github.com/uosl/advent-of-code/blob/master/src/aoc2018/07.clj let me know if you use it so I can check it out!

namenu08:12:20

great! i'll have to dig into your code 🙂

markw09:12:04

I’ve been meaning to play around with that at some point.. never done any logic / prolog stuff before

markw09:12:29

yeah tonight i needed a quick win after the past couple puzzles…

gklijs09:12:14

Anyone stuck on day 15, there is a corner case I ran into which is not tested in the examples. When there are multiple targets at the same distance, you should pick the path to the enemy closest in reading order and not the part starting with a step closer in reading order.

fellshard10:12:32

I believe that is stated in the problem definition, if not in the examples, though. This is definitely the kind of problem where it'd help to have a good catalogue of examples to run through, though.

gklijs10:12:54

It is, but there are so many rules, it's easy to miss one and have the priority a little different. For my data the difference was only 12 HP the elf's had less.

pesterhazy15:12:08

Skipped a day and took me a while to catch up - I didn't want to open up Slack again before being all caught up, to avoid spoilers

pesterhazy16:12:57

I thought the roguelike was a lot of fun, but it takes some time

pesterhazy16:12:27

Wow, only 2200 people finished day 15, down from 6000+

pesterhazy16:12:33

In day 16 I was bitten by partition again, which silently drops the last group if it isn't complete. I really feel partition-all should be the default

pesterhazy16:12:31

10 people finished day 15 in less than an hour !

regen16:12:12

i'm glad day 16 was a fun problem, in comparison to the previous one which I didn't even read through after seeing the comments here...

norman16:12:42

People get frustrated easily. I don’t love the problem, and ended up finishing part1 in the morning. It was a bit more fun without the “I need to figure this out so I can get to bed” pressure

norman16:12:46

It really wasn’t hard, it was just annoying to figure out what the problem was asking. (and annoying when you didn’t have a test case that demonstrated what you were doing wrong)

regen16:12:26

maybe i'll give it an attempt next year. i just don't feel like spending 6 hours on that this weekend ^^

norman16:12:48

1/3 of that is coding 2/3 of that is figuring out the instructions. If you can find a good restatement of the problem into english, I bet you can get it quickly

regen16:12:32

i guess it's a bit like the flower pot problem then? i spent a lot of time rewriting that as i gradually learned how those rules applied

norman16:12:10

Maybe. I thought that one was very clear. I never had any doubt about what to do - just how to do it. For day 15, I often didn’t understand what the problem was asking to do

pesterhazy16:12:57

FWIW I think the instructions have been clear for most (all?) days almost to a fault

pesterhazy16:12:29

Which doesn't mean that I didn't misread them - but that's on me for being hasty

norman17:12:12

Obviously some people understood 15 out of the gate and got it relatively quickly.

pesterhazy17:12:43

I think this type of problem will be hard to phrase unequivocally, no matter how good of a writer you are

pesterhazy17:12:19

Day 15 was almost too verbose - in some places the description felt like it was reiterating what it just said. But of course in other places, I needed to have the logic repeated to me to get it into my head

fellshard18:12:57

The more I think about it, the tighter the pathfinding could be. It really does turn into a simple BFS, priority sorting by [distance, position, ancestor] (where ancestor is the tile you would move to in order to approach position)

pesterhazy18:12:07

I took it as an opportunity to learn how A* works

pesterhazy18:12:34

Which was fun - it’s an elegant algorithm

pesterhazy18:12:45

Got to use java.util.HashMap and j.u.PriorityQueue for the first time

meikemertsch17:12:48

I might be odd but I enjoyed day 15. It was a ton of work, granted, but I had fun and learned a lot. I guess for more experienced people it felt more like homework…. Day 16 was cool because I knew exactly what I wanted to do

meikemertsch17:12:30

And it helped me with a problem on 4clojure that I hadn’t done before

pesterhazy18:12:56

Nice use of fixed-point

regen18:12:48

first defmacro i've seen here [=

mfikes18:12:59

Hah. And, if you look closely, you will see that I'm using defmacro in ClojureScript. 🤔

pesterhazy18:12:27

The fixpoint trick reminds me of sickpea

mfikes18:12:00

@ I got stuck on that part (not seeing how to proceed), but took a peek at your solution to get unstuck

mfikes18:12:57

(I was stuck on the point that my intersections were doing nothing, but I failed to see there was a singleton that could be leveraged.)

quoll06:12:08

The problem with falling behind (Xmas parties are a thing at this time of year) is that I think I’m doing something clever only to discover that someone else did it a few days before I did

quoll06:12:26

I nearly used a fixpoint, but decided it was easier to see when I’d cleared all of the ambiguities

quoll06:12:37

well… sort of the same. I kept reversing my map, because each time I did, new singletons emerged. Bijective mappings are like that 😄

pesterhazy18:12:04

BTW I came up with a pattern. I have emacs running on the left half of the screen and a terminal with rebel-readline on the right. Whenever I reload the namespace, my test function gets re-run automatically: https://github.com/pesterhazy/advent2018/blob/master/src/advent/puzzle16.clj#L140

misha23:12:21

reduce all the things!

misha23:12:58

did anyone actually use core.logic for day16? I spent half of the day neck-deep in tutorials and videos, and implemented solved "mapping" with a loop and a bunch of recurs instead kappa

taylor01:12:18

this book is really useful for learning it https://mitpress.mit.edu/books/reasoned-schemer