Advent of Code 2022 is nigh

by dpeckon 12/1/2022, 3:25 AMwith 141 comments

by discmonkeyon 12/1/2022, 4:21 AM

Time for my yearly tradition of making it to day 4 in Haskell and feeling very smart before completely giving up on the first hard problem that needs regular arrays :)

by xavdidon 12/1/2022, 4:41 AM

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 years, I've done a daily explanation of the solution. I use interesting parts of the Python stdlib and walk readers through common algorithms. I've found it _incredibly_ rewarding and plan on doing it again this year.

You can see all of those solutions here: https://github.com/xavdid/advent-of-code/tree/main/solutions

Please let me know if you enjoy reading these, I love hearing from folks!

by jiggawattson 12/1/2022, 5:27 AM

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 where a naive approach would take a million years of compute, or exabytes of memory. Have multi-gigabyte inputs[1] such that the time-to-solution isn't just how fast you can bang out some simple parsers and loops, but the runtime performance would materially affect your time score.

[1] A method for this would be to use an input-file-generator that is small to download but can generate huge puzzle inputs.

by javajoshon 12/1/2022, 4:02 AM

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.

by matsemannon 12/1/2022, 5:17 AM

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!

by macintuxon 12/1/2022, 4:43 AM

Different style of challenge that launched this year (found it in another HN thread a few weeks ago): https://protohackers.com

You're asked to write server code that meets the given protocol definition.

by w-mon 12/1/2022, 5:57 AM

If you want to join a small just-for-fun leaderboard to keep you motivated to go through to the last puzzle, feel free to join 194284-90c48b41

I've created this leaderboard last year and announced it here. It has a few people I know personally, and a few people from HN I've never met.

There's no community Discord or anything like that. The only form of communication are the stars appearing after other people's names after a while :)

by marshmallowmadon 12/1/2022, 6:50 AM

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.

by wodenokotoon 12/1/2022, 12:37 PM

How much external help do you guys seek out for these puzzles?

Last year I solved two puzzles by looking up the answer on reddit, and other than that I tried to solve them as is. But I feel like it is sometimes a bit like solving a puzzle is a bit like reinventing parts of math and computer science if you didn't happen to have learned those from school or a book.

by b5non 12/1/2022, 4:19 AM

Elixir ended up being a great choice last year. I contemplated using ocaml, sbcl, or guile this go round but ultimately decided to see how far I can get with awk. I'm feeling confident I can get by with awk using getline as needed, we'll see how long I endure...

Best of luck to everyone!

by reducesufferingon 12/1/2022, 6:53 AM

PSA for anyone that doesn't like the verbosity: the bolded white words are the key info.

Here's how today's #1 did it (day 1 solution SPOILER): https://youtu.be/Vl1w7kWRtDg?t=144

by aliqoton 12/1/2022, 4:19 AM

Once more unto the breach, dear friends, once more

by mikewaroton 12/1/2022, 7:31 AM

I'm doing it in Lazarus/Free Pascal again.

https://github.com/mikewarot/Advent_of_Code_in_Pascal

by craniumon 12/1/2022, 8:26 AM

I really like how the Advent of Code is structured. Not only it makes you think about how to solve the problem, it pushes you to architecture your code defensively so when you get the new requirements in part 2, you have the least amount of code to change. I remember being bitten in a problem involving a keypad: I didn't think the keypad shape could change!

by BooneJSon 12/1/2022, 5:31 AM

I’ve used AoC to dabble in new languages. This time I’m going to learn emacs instead. Vi/vim for over 20 years…

by hubraumhugoon 12/1/2022, 4:55 AM

I wonder how helpful GPT-3 and Copilot will be for this :) Not necessarily to solve the whole puzzle but rather to give hints when I'm stuck with a particular task.

by bmitcon 12/1/2022, 8:05 AM

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.

by 4pkjaion 12/1/2022, 4:04 AM

I love Advent of Code. I learnt Rust while solving last year's puzzles.

by asicspon 12/1/2022, 4:59 AM

If you are interested in Linux CLI text processing exercises (beginner to intermediate level), I'm working on a TUI app: https://github.com/learnbyexample/TUI-apps/tree/main/CLI-Exe...

by lynguiston 12/1/2022, 9:24 AM

Oh no, I forgot about this! I’m in the holidays and specifically didn’t take my laptop with me!

by hiyeron 12/1/2022, 4:44 AM

Last year I completed it in Python, but I'm pretty familiar with the language. This year I want to try in a new language - mostly either zig or rust. Eager to see how far I can get!

by markeibeson 12/1/2022, 8:31 AM

You can also try https://advent-of-pure-code.vercel.app/ as an alternative

by markus_zhangon 12/1/2022, 4:13 AM

Last year I went through 8 of them. I wonder what's the theme of this year. Hopefully it's somewhat closer to CPU design (because reading Soul of the new machine)

by TheBrokenRailon 12/1/2022, 4:42 AM

I'm excited to try again this year! Last year, I only got 7 days done before getting distracted because of how crazy December is.

by nikolayon 12/1/2022, 4:57 AM

No, I'm not doing it. At least, I'm not doing it in real time! What a time waster - my family hated me! Sorry, offline holidays and online programming contest don't mix well! Enjoy your life, solve the problems after the holidays!

by kazinatoron 12/1/2022, 3:59 AM

Some AoC 2021 solutions in TXR Lisp: https://www.kylheku.com/cgit/advent/tree/2021

by schemescapeon 12/1/2022, 5:19 AM

Is there any way to play without logging in (for previous years, if necessary)?

I couldn't find anything on the About page that clarifies this.

Edit: I see anonymous users in the leaderboard, so it seems like it might be possible.

by oweileron 12/1/2022, 7:31 PM

Wanted to use Rust this year but bc of time constraints felt back to Kotlin script, which is perfect for these kinds of tasks.

by anxiouslyon 12/1/2022, 3:47 PM

Looks like fun. Too bad you can't sign up anonymously or simply with a username and password. What a shame.

by shaftoe444on 12/2/2022, 12:00 PM

For the first time in years I'm going to use my day to day language and not try anything fancy!

by hk1337on 12/1/2022, 4:22 AM

Have you been impish or admirable?

by plandison 12/1/2022, 4:18 AM

I did this for the first time last year. It was fun! Really excited to do in again.

by hansvmon 12/1/2022, 4:43 AM

I was just telling all my computer-adjacent friends about this. Hype hype hype!!

by julianeonon 12/1/2022, 4:03 AM

Can't wait.

by axiom92on 12/1/2022, 4:07 AM

I'm ready with my codex key.

by Drblessingon 12/2/2022, 2:21 AM

Lets go!

by brudgerson 12/1/2022, 4:38 AM

Advent is not an event that resonates with me.