Live data from Hacker News

Advent of Code 2022 is nigh

adventofcode.com

111–120 of 150 posts

Re: Advent of Code 2022 is nigh

#111
post #70

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.

Last year when I was doing AoC in Go, I was pleasantly surprised how good Copilot is and it felt like magic. Given most of the time I use Terraform, YAML, JSON, jq, and Bash these days, I can't really appreciate Copilot, but last year I did!

I ended up turning off Copilot last year since it was literally giving me complete correct solutions with no effort on my part. Kind of took the fun out of it.

Re: Advent of Code 2022 is nigh

#112

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.

[deleted]

Re: Advent of Code 2022 is nigh

#113

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…

ehm

I did s.split("\n\n").fold... But this was first thing in the morning and where I lost time was that what I actually did at first was: s.split("/n/n")

Re: Advent of Code 2022 is nigh

#115

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!

1. Have everything in place at the start (a script to grab the inputs helps). 2. Use a language that makes the edit/run cycle short. 3. Be very familiar with that language and how to process input in it. 4. Have solved many similar problems in the past so you can parse these problem statements quickly. 5. Have solved many similar problems in the past so you know exactly what code to write or use (if you have a utilit…

How do you grab the inputs? I get the following error:

     curl https://adventofcode.com/2022/day/1/input   
    Puzzle inputs differ by user.  Please log in to get your puzzle input.

Re: Advent of Code 2022 is nigh

#116
post #77

Earlier quoted context omitted.

Try Ocaml instead :)

I tried that last year, and got worn down by how often I'd Google how to do something and get an answer explaining how recursion works from first principles as opposed to just pointing at the deciding standard library function that did what I needed. I want to try again this year, do you have any advice for how to get going with Ocaml as someone who has programmed long enough to understand how recursion, linked lists…

I'm not an OCaml expert either. I've used Haskell professionally a little bit and also know OCaml. I find OCaml more practical because you don't have to fight with "pure" functional programming when you really want an imperative algorithm. For example, OCaml provides mutable arrays even though it encourages functional style whenever possible.

One downside of OCaml is that its standard library is not very powerful and there are multiple third party replacements that are popular. Jane Street's base/core, Containers, Batteries Included, to name a few. So you have to make a choice.

Having said that, I think you can live with the built in standard library to solve most of the AOC problems.

Re: Advent of Code 2022 is nigh

#117

Earlier quoted context omitted.

1. Have everything in place at the start (a script to grab the inputs helps). 2. Use a language that makes the edit/run cycle short. 3. Be very familiar with that language and how to process input in it. 4. Have solved many similar problems in the past so you can parse these problem statements quickly. 5. Have solved many similar problems in the past so you know exactly what code to write or use (if you have a utilit…

How do you grab the inputs? I get the following error: curl https://adventofcode.com/2022/day/1/input Puzzle inputs differ by user. Please log in to get your puzzle input.

There's a session token in your browser cookie for the site, you have to pass that to the server. Honestly, though, I'm not going to be in the top 100 so I don't bother anymore. I open the input and hit Cmd-s and save it to my inputs directory. I've made it into the top 100 precisely one time in the 4 years (this is my 5th) I've participated, and I honestly don't know why I was in the top that time. It wasn't a terribly hard problem (for the folks that were reliably making it in the top 100) if you'd done the earlier parts since it was a simple search (increment register 0 value, check that it's not in a cycle, and count the number of executed instruction if it halts). You did need to complete day 16 first though, and it was closer to Christmas itself so maybe that was why.

If you do use a download script make sure you check whether or not you've downloaded it before. He's also requested that you put in a user agent that provides some contact info (rather than being generic). The server has been getting slammed by people hitting it too often and he's considering banning some, and wants a way to reach out to people who may have a misbehaving script.

https://adventofcode.com/2018/day/21 - My one top 100 result

https://adventofcode.com/2018/day/16

https://www.reddit.com/r/adventofcode/comments/z9dhtd/please...

Re: Advent of Code 2022 is nigh

#118

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

Agreed. I was looking forward to it, because puzzles, but yeah, no. I am not an enterprise, don't care to lock me down to a specific service.

Re: Advent of Code 2022 is nigh

#119
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.

Only if language choice isn’t correlated with timezone. I suspect for many it is.

Re: Advent of Code 2022 is nigh

#120
post #21

Earlier quoted context omitted.

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 anot…

One of the things I really loved about the IntCode problems was best exhibited by that Breakout game. One way of solving the problem was to create a joystick, as you said, but if you had built an IntCode inspector/debugger, you could also dig into the game code itself (your puzzle input) and find out where the blocks were in memory, and how much each one was worth, and just sum it up directly.

It reminded me of Wastl's other big puzzle collection (Synacore) which also had a big emphasis on implementing a VM to host further puzzles on top of.

Post reply on HN