News for hackers. Stuff that matters.
Re:Advent of Code 2018 by w4tson on Thursday November 29, 2018 @02:27PM (#18563110)
For day 3 in 2017, the spiral. Were you just aware of this concept before hand?
Re:Advent of Code 2018 by saagarjha on Thursday November 29, 2018 @03:14PM (#18563519)
I’m not OP, but if I were solving this I’d just take the smallest square less than that number, figure out where it is (the top left or bottom right corner), and then “run” the algorithm from there, which should only require one “turn” at the most. You really don’t need to know anything about spirals in particular; just look for a pattern that you can take advantage of to reduce your work.
Re:Advent of Code 2018 by w4tson on Thursday November 29, 2018 @05:08PM (#18564578)
You make it sound so easy. Part 2 was the real gnarly bit.

Anyway I’m sure I won’t ever encounter that spiral as long as I live but if I do, I have code prepped for it :D

Re:Advent of Code 2018 by saagarjha on Thursday November 29, 2018 @05:20PM (#18564679)
Oh, I didn't see that. The Advent of Code website is strangely annoying in that it makes it extremely difficult to find past problems…

Based on what I found online (which is abridged rewordings of the problem, something of a sequence sum?) I'd get lazy at that point and implement something that makes the spiral. Presumably, this shouldn't take to long, as the sequence grows rapidly so they can't give us a number that's too big…

Re:Advent of Code 2018 by kingaillas on Thursday November 29, 2018 @05:43PM (#18564857)
>extremely difficult to find past problems…

Huh? Click [Events], click on the year, click on the day.

Re:Advent of Code 2018 by w4tson on Friday November 30, 2018 @01:19AM (#18567153)
The second (and sometimes much harder) part of each days problem is only revealed when you complete the first part.
Re:Advent of Code 2018 by nneonneo on Thursday November 29, 2018 @04:22PM (#18564135)
I was not particularly fast that day. If I recall correctly, I just bruteforced it (implemented the four-turn logic). Not elegant but it runs fast enough :)
Re:Advent of Code 2018 by w4tson on Thursday November 29, 2018 @05:06PM (#18564561)
Me too, good to know ;)