Live data from Hacker News

Advent of Code 2019

adventofcode.com

31–40 of 124 posts

Re: Advent of Code 2019

#31
post #10

This is my first year. As I missed the start time I created an event to remind me and published it for anyone else who'd wish to subscribe. https://calendar.google.com/event?action=TEMPLATE&tmeid=M203... Looking forward to the fun, the stress and the eventual euphoria.

Could not find the requested event...

Re: Advent of Code 2019

#32

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

I completed the whole thing last year; the problems start out very easy, but get dramatically more challenging over the course of the month. Check out the statistics for how many people completed each problem in 2018: https://adventofcode.com/2018/stats

The first few problems are approachable by pretty much anyone who understands how to do arithmetic, file I/O and basic flow control. Many of the later problems require advanced skills such as more sophisticated algorithms (graph theory, dynamic programming, etc.), reverse engineering, and careful debugging.

For what it's worth, I would expect anyone who knows what a loop is to be able to get the first half of today's problem without much difficulty. The second half is a bit less trivial but also pretty easy to understand.

Re: Advent of Code 2019

#33

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

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 easy. The second part is then a twist that requires a change to the solution of the first part.

Apart from that, you can always skip a day if you just can't solve it. The exception is that sometimes a puzzle can reference the solution of an older day, so if you'd solved the older day you would already have an understanding of how to proceed, and might be able to reuse some code.

Re: Advent of Code 2019

#34

Earlier quoted context omitted.

It rounds down the quotient

How intuitive. But thanks anyway.

In Python 2, floor division is the default for integer arguments and exact (to within machine precision) division the default for floating point arguments, but this caused a lot of unnecessary confusion: new users were surprised that 3.0/2.0 == 1.5, but 3/2 == 1.

Thus for Python 3 the new // operator was added for explicit floor division (which is often quite useful in its own right), leaving the / operator to always return an exact (to machine precision) floating point result, even with integer arguments.

cf. https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...

Re: Advent of Code 2019

#35

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

They take 2h

First couple of tasks are really easy, but difficulty increases over time and so does time needed to solve them.

Someone who is currently learning about loops might not be able to solve these on their own, but with someone else's help they might learn lots of useful concepts (e.g. linked lists, bfs, basic asm, how to code efficiently...) and try to apply them.

AoC are solving usually those who are quite familiar with programming and want to learn a new language or to compete with colleagues.

Re: Advent of Code 2019

#36
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 answer [2] within a minute of checking.

Looking back at the first stage, I found a sequence for it [1] and PARI/GP code i could run to answer the question. If I had used oeis immediately I would have a solution to both phases in 2 minutes which would be the fastest on the old leaderboard for the problem [3].

[0]:https://adventofcode.com/2017/day/3

[1]:https://oeis.org/A214526

[2]:https://oeis.org/A141481

[3]:https://adventofcode.com/2017/leaderboard/day/3

Re: Advent of Code 2019

#37

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.

Re: Advent of Code 2019

#39

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

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.

Re: Advent of Code 2019

#40

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

If you're medium fast, they start out in the single digit or tens of minutes range and ramp up to some 60+ minute puzzles the last handful of days (but also some 20 minute puzzles, it varies a lot).

I haven't done it since 2017, and I was pretty quick (made that year's overall leaderboard), but on average they took me about 23 minutes (for both parts).

Post reply on HN