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
Average-user 2018-12-24T02:07:28.076800Z

Maybe there is a way of transforming the set of points, into an equivalent one, with points closer and smaller radius

Average-user 2018-12-24T02:07:38.077100Z

And then check the surfaces

fellshard 2018-12-24T04:34:38.078400Z

I considered starting from a 'center of mass', maybe see if 'all nanobots weighted same' and 'all nanobots weighted by radius' made any sense

gklijs 2018-12-24T08:43:31.079900Z

I solved it now, by first picking the best corner, then from there looping both logarithmic and linearly till it doens't improve anymore.

👍 1
gklijs 2018-12-24T11:17:09.080300Z

Turned out best corner had little value, just searching from the origin went almost the same time. 3 cycles more to find the correct answer, but not the 6000 evaluations to find the best corner.

Average-user 2018-12-24T15:10:46.080500Z

In my case, there is no neighbor of the best corner that has is in range of the same or grater amount of nanobots, so a walk is not possible I think

gklijs 2018-12-24T17:35:43.081100Z

It's no walk I do, it's about 13 cycles of jumping all over the place from 2^0-2^30 and that in all detections.

gdevincenzi 2018-12-24T19:17:20.082900Z

hey folks! beginner clojurist here. If someone could give me a few pointers on how to improve my day 9 code, I would be very thankful. I can't seem to find a fast enough approach. https://github.com/gdevincenzi/advent-of-code-2018/blob/puzzle09/p09/zipper.clj

misha 2018-12-24T20:10:40.084Z

@gdevincenzi "trick" to day9 was deque (double-ended queue) data structure

gdevincenzi 2018-12-24T20:11:17.084500Z

I'm not sure how to implement one in a functional way, but will try to find out more about it

misha 2018-12-24T20:13:07.086100Z

someone has a deque implementation as a lib. I used mutable java one: https://github.com/akovantsev/adventofcode/blob/master/src/adventofcode/2018/day09.clj

gdevincenzi 2018-12-24T20:13:32.086500Z

thanks 👍

misha 2018-12-24T20:14:14.087100Z

was a very good reminder how actually careful you should be with mutable things, god bless :rich:

gklijs 2018-12-24T22:24:11.090200Z

You don't need deque for day 9, it's just pointers forward, and sometimes you need to know witch state you where in to get back.

gklijs 2018-12-25T11:51:52.096200Z

That's what I meant