This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (76)
- # aleph (1)
- # aws (2)
- # beginners (101)
- # boot (1)
- # boot-dev (1)
- # calva (25)
- # cider (12)
- # cljs-dev (29)
- # clojure (214)
- # clojure-europe (1)
- # clojure-nl (5)
- # clojure-spec (1)
- # clojure-uk (6)
- # clojurescript (155)
- # data-science (1)
- # datomic (48)
- # figwheel-main (5)
- # immutant (1)
- # leiningen (11)
- # nrepl (2)
- # off-topic (24)
- # pathom (2)
- # pedestal (2)
- # portkey (8)
- # protorepl (5)
- # re-frame (2)
- # rum (4)
- # shadow-cljs (21)
I might do day 15, but if there is other problem like this one this year I may quit the whole thing
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
p2? I'll just let it run overnight and submit result. totally not worth it, although I have an optimization in mind.
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.
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
@fellshard Can you use
sorted-set-by instead, where the set contents are the items and the sort fn is the item->priority fn?
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.
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.
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
manually that is… maybe tomorrow i’ll code it.. i always feel dirty/guilty doing it by hand
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)
let me know if you use it so I can check it out!
I’ve been meaning to play around with that at some point.. never done any logic / prolog stuff before
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.
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.
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.
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
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
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...
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
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)
maybe i'll give it an attempt next year. i just don't feel like spending 6 hours on that this weekend ^^
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
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
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
FWIW I think the instructions have been clear for most (all?) days almost to a fault
I think this type of problem will be hard to phrase unequivocally, no matter how good of a writer you are
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
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
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
Hah. And, if you look closely, you will see that I'm using
defmacro in ClojureScript. :thinking_face:
@U06F82LES I got stuck on that part (not seeing how to proceed), but took a peek at your solution to get unstuck
(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.)
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
I nearly used a fixpoint, but decided it was easier to see when I’d cleared all of the ambiguities
well… sort of the same. I kept reversing my map, because each time I did, new singletons emerged. Bijective mappings are like that 😄
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
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