Live data from Hacker News

Advent of Code 2019

adventofcode.com

41–50 of 124 posts

Re: Advent of Code 2019

#41

These are daily programming puzzles? How long do they take on average? Also, I know somebody who is just starting out at coding. Would it be too hard for them? They are brand new, learning about loops

For someone just starting out they would get stuck on this very first problem, it involves recursion. People 'get' recursion, but coding it is something different.

It doesn’t need recursion, you can do a while(round(x/3)-2 > 0) type thing, but recursion is simpler.

Re: Advent of Code 2019

#42

Earlier quoted context omitted.

In general the puzzles involve basic operations that any language would have. Functions, data structures, recursion, some amount of back-and-forth between strings and numbers and records. There isn't any reliance on library-like things like making HTTP requests or parsing complex file formats. I think they would be fine for someone starting out at coding. Every day's puzzle has two parts. The first part is usually ea…

> I think they would be fine for someone starting out at coding. The earlier ones, perhaps, but professional programmers struggle with the later ones. I’d never suggest that some one new to programming tries to do all of AoC.

It really helps to (1) have taken an algorithms class and (2) be aware of Python libraries that implement common graph algorithms if you're going for time. At least, that was my impression 2016-2017. The later puzzles are impossible if you don't know a good enough algorithm (they're more or less designed to take impossible amounts of time to completely brute force).

I'd suggest new programmers do any they can reasonably understand and just skip ones that seem like they'll be frustrating or require a "fast" algorithm they don't know. (OTOH, many days' first star can be gotten with a brute force algorithm. It's usually the 2nd star that takes something more clever.)

Re: Advent of Code 2019

#43

I was doing a little of catching up on older problems to improve my speed to get on the leaderboard and I found that the fastest way to finish one problem was to use oeis. After seeing the problem [0], I didn't immediately think to use oeis because the manhatten distance of a spiral is pretty easy to code or do by hand. The second stage has a harder sequence though. It prompted me to check oeis and I easily got the a…

I had plenty of 20-20 hindsight about faster ways to have solved puzzles in the past. I don't know if I was ever #1 on any day on either star. I think I might've been top 10, on one star, of one day, once.

Re: Advent of Code 2019

#44
post #5

Always enjoy doing these but there was one last year that nearly broke me. I think it was day15. It was the worst combination of mind-numbing coding and horribly hard to debug special cases. It was purely convoluted with very little to think about which makes for the worst kind of puzzles

That one wiped me out for a week too, and caused borderline psychological problems. Ultimately though I realised that if I followed the description word by word, and made no assumptions, then I got the right solution. Still, a nightmare: you could pass all the examples, or even some alternate real sample data, and still get it wrong if you got the ordering slightly incorrect.

Yeah, it's really frustrating when the text summary is vague and underspecified. It makes it hard to understand exactly the result the author is looking for, which isn't the fun kind of puzzle.

Re: Advent of Code 2019

#45
post #29

Earlier quoted context omitted.

Last year I started out using elixir, but I got filtered due to the goblins...

What does this mean?

Probably Day 15 [0] from last year. It was challenging, especially because there were so many rules to implement (in a short time). A slight misreading of the rules would let you pass all the provided examples, but fail on the real input.

[0] https://adventofcode.com/2018/day/15

Re: Advent of Code 2019

#46

Earlier quoted context omitted.

For someone just starting out they would get stuck on this very first problem, it involves recursion. People 'get' recursion, but coding it is something different.

It doesn’t need recursion, you can do a while(round(x/3)-2 > 0) type thing, but recursion is simpler.

Nothing 'needs' recursion, it's always equivalent to an iterative solution. In some languages a recursive solution is more natural and may perform better.

Re: Advent of Code 2019

#47

Earlier quoted context omitted.

What does this mean?

Probably Day 15 [0] from last year. It was challenging, especially because there were so many rules to implement (in a short time). A slight misreading of the rules would let you pass all the provided examples, but fail on the real input. [0] https://adventofcode.com/2018/day/15

Idiot-proofing is hard. Figuring out everything people will get wrong is the only reliable way to ensure people don't, but that takes more insight than is needed to set and solve problems correctly.

Re: Advent of Code 2019

#50

Earlier quoted context omitted.

Probably Day 15 [0] from last year. It was challenging, especially because there were so many rules to implement (in a short time). A slight misreading of the rules would let you pass all the provided examples, but fail on the real input. [0] https://adventofcode.com/2018/day/15

Idiot-proofing is hard. Figuring out everything people will get wrong is the only reliable way to ensure people don't, but that takes more insight than is needed to set and solve problems correctly.

No doubt. I wasn't really complaining, but that was the one that seemed to cause the most headaches last year. And the text had the problem fully specified, there really was no good way to make it better other than perhaps a different presentation (also a hard problem) or a few extra test cases to tease out those potential misreadings. But you can't catch every error for the participants, coming up with tests is part of the challenge.
Post reply on HN