Live data from Hacker News

Advent of Code 2022 is nigh

adventofcode.com

81–90 of 150 posts

Re: Advent of Code 2022 is nigh

#81
post #61

Earlier quoted context omitted.

> site should ask for the language used to solve the problem and then use this as semi-scientific data for comparing "time-to-solution" for various languages. I think this would just show you the average time zone of the language's users.

Today 4 minutes gets you top 1000. There’s more than enough users starting when the problem gets released that an analysis could be done by checking for solutions submitted within the first hour.

I generally find time to solution uninteresting and that how closely the solution models/mimics the problem statement the far more interesting thing.

I imagine that there’s a wide breadth of languages showing up in the top results but would guess that it skews towards imperative languages. Yet, the functional languages will almost read like the problem statement, which is what I find wonderful.

Re: Advent of Code 2022 is nigh

#82

I wonder how the persons on the leader board manages it? First person today solved part1 after 39 seoncds, and was done with part2 after 53 seconds! I felt I was quite fast in being done with part1 after 3 minutes and part2 in 4 minutes (rank ~1000). I even tried to skimread the explanation to be fast, have a script to download the input and run it etc., but still no match!

A comment further down this thread reveals it: https://news.ycombinator.com/item?id=33813169

Re: Advent of Code 2022 is nigh

#83
post #26

AoC is one of my favorite events of the year! I find the puzzles generally approachable, but interesting enough to spend time on. I also like that there's a definitively right answer, which motivates me in an interesting way. I've developed a base class over the years that handles input parsing, so I can focus more on the solutions themselves. Additionally I've been solving for a number of years, but for the past 2 y…

I just skimmed through your repo, and I loved the way that you used AoC as an opportunity to share many of the batteries that are included in the Python stdlib. In one particular case, I wanted to also share some more fun corners of the collections module / common algorithms and sent you a pull request.

Re: Advent of Code 2022 is nigh

#84

Earlier quoted context omitted.

I felt similar last year. I was trying to do them in Zig and Rust, and it felt like most of the challenge was just writing custom data parsers for poorly formatted data which felt too much like my day job.

> felt too much like my day job Agree. I think it helps to do it in a language you're not familiar with, or with some artificial limitation on how to solve it (no third party libraries for instance). It takes more time, but felt less like a grind for me.

Last year I have used Python without using any imports and, whenever I felt like it, tried to golf it as much as I could. Turned out easier than I expected, even without any libraries Python is pretty powerful for this kind of tasks: https://gitlab.com/dos1/AoC21

There were only like two or three days that felt frustrating, but mostly because of the problem being poorly specified.

Re: Advent of Code 2022 is nigh

#85
post #21
post #3

I did several of these last year and found them deeply unpleasant. I like puzzles but some puzzles are just...bad. Like the ones that require you to just brute force a solution, or write lots of detailed code to capture the requirements...that shouldn't be what this is. Just my opinion, of course, but like I said I found last year an unpleasant chore that felt more like work. Hope it's not like that this year.

Each year does vary slightly in theme and focus, so it's possible you'll have more fun this time if you give it another chance. Or not. But remember that it's never too late to give up. :) My favorite so far is 2019, where several of the problems had you write and extend an emulator for the imaginary (and wacky) "IntCode" computer.

2019 was excellent. Each day, the puzzle would have you adding new features (new instructions, addressing modes, input/output handling) to the emulator. The early days were fairly simple, but things got progressively more complicated. On one day the puzzle input was code that played a game of Breakout. Your task was to implement an emulated joystick that would play perfectly. The solution was the final score. On another day the puzzle required several virtual machines running in parallel feeding the output of one into the input of the next to get the final answer.

Reddit r/adventofcode is also fun. People post not only solutions in various languages, but visualizations of solutions (e.g., an animation of that game of Breakout). Sometimes people post fun things, like a solution to a puzzle in Apple II BASIC and a video of it running on an actual Apple II.

Re: Advent of Code 2022 is nigh

#86
I'm using Elixir and a Liveview notebook this year to go through it. Using Liveview notebooks is so nice, as you can even add and run `ExUnit` tests within one. So, it's just a single document in which to work with syntax highlighting, formatting, modules, tests, etc.

I may also do it in F# and .NET Interactive notebooks using the Polyglot Notebooks Visual Studio Code extension, but I suspect the solutions will look very similar.

Re: Advent of Code 2022 is nigh

#87

Every time I do the AoC puzzles I wish for two things: 1) The site should ask for the language used to solve the problem and then use this as semi-scientific data for comparing "time-to-solution" for various languages. The sheer volume of data and the relatively high difficulty of cheating on novel problems would make this data set interesting and maybe even useful. 2) I wish all the puzzles had a "hardcore" mode whe…

Part2 is quite often what you wish for in 2), isn't it? At least for the later puzzles, part1 is often something that can be solved naively, while part2 needs some cleverness to not blow up.

Yeah, usually part 2 is. Bear in mind that tonight's puzzle is a warmup, it's day 1 after all!

I do find there's usually one or two spots that you can eek by with threads and throwing compute power at the problem. But those are rare — usually you have to actually solve it.

Re: Advent of Code 2022 is nigh

#88

I wonder how the persons on the leader board manages it? First person today solved part1 after 39 seoncds, and was done with part2 after 53 seconds! I felt I was quite fast in being done with part1 after 3 minutes and part2 in 4 minutes (rank ~1000). I even tried to skimread the explanation to be fast, have a script to download the input and run it etc., but still no match!

Do you want to be fast, or do you just want to have fun? Who cares what others do with the game? Have fun while doing it

For the easier tasks, my "fun" is doing it as quickly as possible first ;) Then I rewrite it with a goal in mind, for instance entirely functional with no mutations, as a single expression or whatever.

Re: Advent of Code 2022 is nigh

#89

First day was a pretty fun start. Just heard about this for the first time this year and going to give it a go. Tangential question - why does the HN crowd hate these types of questions in interviews but apparently likes to do them on their own time? Different folks answering to different posts? Honestly curious.

It's optional in this context.

Why would it be optional in an interview? You want a job, I want to know that you've seen software development before.

(Now for context, the interview questions I typically would recommend are a order of magnitude easier than AoC's typical bar, in the language of the candidate's choice, ideally on a real computer and not a whiteboard. Tonight's question though (a warmup) wouldn't be a bad one. It's straight-forward, no trickery, nothing clever, and directly applicable to real-world coding. And it would screen >50% of candidates that I'd give it to.)

Re: Advent of Code 2022 is nigh

#90

Earlier quoted context omitted.

“Have solved many similar problems in the past so you can parse these problem statements quickly” This sounds like an advent of code specific thing. The problem itself is trivial, no need to have solved anything similar in the past, but the description is so verbose (because it’s a cute Santa-related story) that it becomes hard to parse the problem we’re trying to solve, quickly. I don’t think this is common in any o…

Feel I have to disagree on this one. Firstly, most programming competitions I've been to have this kind of problem description as well, just check Kattis problems for instance. But secondly, while the problems in the beginning are trivial, you still have a huge advantage if you can immediately start programming without having to think, or having to look up a function in the stdlib. (Spoilers:) I probably wasted a min…

[deleted]
Post reply on HN