[HN Gopher] Advent of Code 2024
___________________________________________________________________
Advent of Code 2024
Author : thinkingemote
Score : 951 points
Date : 2024-12-01 09:09 UTC (13 hours ago)
(HTM) web link (adventofcode.com)
(TXT) w3m dump (adventofcode.com)
| arjvik wrote:
| 9 seconds to get both stars is absolutely insane - there had to
| be some AI assistance here.
|
| Come to think of it, a pipeline that feeds the problem text into
| an LLM to generate a solution and automatically runs it on the
| input and attempts to submit the solution, doing this N times in
| parallel, could certainly solve the first few days' problem in 9
| seconds.
| isoprophlex wrote:
| AI coding assistants ruined the global leaderboard experience.
| AoC might as well nerf it by discarding the quickest x percent
| of submissions, or something...
| WithinReason wrote:
| They should check that LLMs can't solve the problems in 9
| seconds and come up with appropriate problems. Or just allow
| AI assistants, they are now as much part of the programmer's
| toolkit as syntax highlighting or autocomplete or Stack
| Overflow, and pretending otherwise is not useful.
| Retr0id wrote:
| The first few days are supposed to be beginner-accessible,
| it's practically impossible to have something beginner
| accessible but GPT-inaccessible.
| martin-t wrote:
| Not gonna happen. AoC always starts with beginner level
| problems. That's why it's so commonly used for learning the
| basics of new languages.
|
| A problem that wouldn't be immediately solvable by LLMs
| would either be too advanced or simply too large to be fun.
|
| This is probably where programming as a whole is going.
| Many of the things that make programming fun for me, like
| deeply understanding a small but non-trivial problem and
| finding a good solution, are gonna be performed much faster
| by LLMs. After all most of what we do has been done before,
| just in a slightly different content or a different
| language.
|
| Either LLMs will peak out at the current level and be often
| useful but very error prone and not-quite-there. Or they'll
| get better and we'll be just checking their output and
| designing the general architecture.
| matsemann wrote:
| That's like going out for a run and taking an electrical
| scooter around the park instead. The point isn't finishing,
| the point is doing the activity.
| WithinReason wrote:
| Then why have a leaderboard?
| matsemann wrote:
| Because someone likes to compete? There are 5k races as
| well, which people enjoy to do even though vehicles
| exist. And people would rightfully be upset if they got
| beaten by someone not running themselves.
| zwirbl wrote:
| And then allow aimbots for counterstrike, stockfish at
| chess tournaments and Epo on the tour de France. The leader
| board is intended for people to compete against each other,
| one could make a separate leaderboard for LLM, kind of
| similar to the chess AI leaderboards.
| falcor84 wrote:
| > allow aimbots for counterstrike
|
| I'm not played counterstrike in over a decade, so you got
| me wondering - are there matches where everyone uses
| aimbots? What does the game look like then? I suppose
| there's a new mix of strategies evolving, with a higher
| focus on the macro movement planning?
| worthless-trash wrote:
| > are there matches where everyone uses aimbots?
|
| Yes
|
| > What does the game look like then?
|
| I have only observed the games, it requires a lot of
| hiding.
|
| Most of the time the winning method is to act at the very
| last second and hope the other player is distracted.
| WithinReason wrote:
| False equivalence. The sole reason for counterstrike and
| chess to exist is competition. Programming is about
| solving a problem. If you want to turn programming into a
| competition you shouldn't take away tools from the
| programmer.
| jbjbjbjb wrote:
| You're saying programming isn't not equivalent to chess
| here because programming isn't a competition, but the
| Advent of Code leaderboard very much is a competition.
| fuglede_ wrote:
| It's not that bad. I'm sure there are more LLM'ers in there
| than the one, but you can tell that the majority of the day 1
| leaderboard is made up of people who have historically
| performed well, even before LLMs were a thing.
|
| Compare https://adventofcode.com/2024/leaderboard/day/1 to
| e.g. https://fuglede.github.io/aoc-full-leaderboard/
|
| There was also at least one instance of people working
| together where you would have 15 people from the same company
| submit solutions at the same time, which can be a bit
| frustrating but again, not a huge issue.
| gorgoiler wrote:
| I have a rule in life: no summary statistics without showing
| the distribution.
|
| Usually this goes for any median which might be in a sneaky
| bimodal distribution of, say, AI models vs humans. I guess it
| applies to leaderboards too though.
| exitb wrote:
| Potentially the challenge just doesn't make as much sense
| anymore? There apparently are ,,mental calculations"
| competitions and I'm sure their participants have fun. Yet I
| can hardly imagine doing arithmetic in ones head is any fun
| for an average mathematician. The challenge just shifted
| elsewhere over time.
| hmottestad wrote:
| OpenAI did something similar with their o1 model. Ran a coding
| problem through o1 thousands or maybe millions of times and
| then checked if the solution was correct.
|
| I can imagine a great pipeline for performance optimization: 1.
| have an AI generate millions of tests for your existing code 2.
| have another AI generate faster code that still makes the tests
| pass
|
| So I guess all I want for Christmas is a massive compute
| cluster and infinite OpenAI credits :P
| nneonneo wrote:
| It was, of course, an AI-generated solution; they posted it
| here:
| https://web.archive.org/web/20241201052156/https://github.co...
|
| Later, after being called out on it, they posted an apology to
| their GitHub profile (https://web.archive.org/web/2024120106481
| 6/https://github.co...): "If you are here from the AoC
| leaderboard, I apologize for not reading the FAQ. Won't happen
| again."
|
| Both the repo and that message are now gone.
| dsissitka wrote:
| For comparison, here's how long it took in past years:
| 2015 - 10:55 2016 - 7:01 2017 - 1:16
| 2018 - 1:48 2019 - 1:39 2020 - 7:11
| 2021 - 1:07 2022 - 0:53 2023 - 2:24
|
| And this year's second place was 0:54.
| fuglede_ wrote:
| Note that regarding the outliers, in 2015 and 2016 the
| puzzles weren't as widely known, and in 2020, AWS' load
| balancers crashed and the puzzle was unavailable to most
| people for 6 minutes, then solved in a few minutes.
| https://adventofcode.com/2020/leaderboard/day/1 --
| postmortem: https://old.reddit.com/r/adventofcode/comments/k9
| lt09/postmo...
| fuglede_ wrote:
| Yep, there was; they even wrote so in their commit message
| before removing it:
| https://old.reddit.com/r/adventofcode/comments/1h3w7mc/2024_...
| Almondsetat wrote:
| Caring about the leaderboards is the problem. Are you
| (impersonal) seriously doing AoC for clout or something?
| nicce wrote:
| I did it without AI last year and planning to do it again,
| for fun.
| zwnow wrote:
| True. Leaderboards are and always have been full of cheaters.
| thinkingemote wrote:
| If people are concerned about leaderboards there are private
| leaderboards:
| https://adventofcode.com/2024/leaderboard/private
|
| Personally I don't do it to compete, I just like puzzles.
| aithrowawaycomm wrote:
| The primary reason to not care about AoC leaderboards is that
| that it penalizes people for being in the wrong time zone.
| That said, the top 100 or so contributors clearly do care
| about these things and using an LLM is cheating.
|
| In particular the LLM cheating isn't just by conjuring a
| solution: humans don't get ASCII characters pumped directly
| into their brain, we have to slowly read problem descriptions
| with our eyes. It takes humans more than 9 seconds to solve
| AoC #1 purely because of unavoidable latency.
| exitb wrote:
| I wonder how many seconds could be won by the organizers if the
| challenge included a blant prompt injection breaking the
| result.
| emadb wrote:
| I participate almost every year but I don't care about the
| leaderboard. The timezone play a crucial role in being able to
| be ready at the right time, so actually who cares? I prefer to
| build private leaderboards with my friends and colleagues.
| rvz wrote:
| At this point, it just shows that Advent of Code is completely
| worthless given the ease and accessibility of AI-assisted tools
| to solve these problems.
|
| RIP Advent of Code.
| wiseowise wrote:
| Sarcasm?
| abenga wrote:
| Why? Solving interesting problems to learn is a worthwhile
| goal. Why should it matter to you that others are "cheating"?
| zwirbl wrote:
| Because competing against other people is the fun part for
| some people. Why not allow everyone to use stockfish at
| chess tournaments?
| zwnow wrote:
| This is stupid though. Advent of Code Leaderbords were
| always full of cheaters. At least since 2020 when I first
| started. If you want competitive programming, AoC is not
| the place for that.
| graynk wrote:
| "For _some_ people" is at odds with "_completely_
| worthless", don't you think?
| dakiol wrote:
| To be fair, I read it as "_completely_ worthless for
| _some_ people"
| rich_sasha wrote:
| Without condoning cheating, I am impressed with the automation
| aspect of it. 9 seconds sounds more or less like the inference
| time of the LLM, so this must have been automated. Login at
| midnight + lots of C&P may not have done it.
|
| Perhaps there is a scope for an alternative AoC type
| competition aimed at AI submissions...
|
| ...though of course that would be experimenting to get us all
| out of work. Hmm.
| zwnow wrote:
| If real life problems were as easy and defined as AoC
| problems we might be able to be replaced at some point. I
| highly doubt you can replace software devs otherwise. Who
| else is going to take the blame for software issues?
| rich_sasha wrote:
| "Write me a snippet that does X" is a step behind "figure
| out how to log into this page, download the data, write a
| snippet that gives the right answer to the sample data,
| then run it on the real thing and submit the output to the
| text box".
| tags2k wrote:
| As with real life, the speed generally doesn't matter as long
| as you get a working solution and you find it fun. If you find
| "copy and paste into an LLM and then copy and paste the answer
| back out" fun, then I suppose you do you.
|
| I didn't realise it was be timed, which is good because I
| casually set up a new rig to give future puzzles some kind of
| rig. I used C# which, although probably more wordy than other
| solutions, did the job and LINQ made light work of the list
| operations. Ended up with about 6.5 minutes for each one but
| most of that was refactoring out of pedantry.
| tmountain wrote:
| It feels like AI will shape a lot of the submissions for these
| types of coding "traditions". But, I guess that's just the world
| we live in.
| Retr0id wrote:
| Even before AI I was never fast enough for a respectable global
| rank, but it's still fun to compare solutions with friends.
| uludag wrote:
| I'm actually pleasantly surprised by the results. I like to
| think that despite problem 1 being easily solvable by LLMs,
| just about everyone (sans qianxyz) read the FAQ, and decided
| that they would forego a leaderboard spot for the sake of this
| coding tradition.
|
| Either that, or there were hundreds of people trying and none
| were able to get it working despite the basic problem. I like
| to imagine most people reading the rules and being a good
| sport.
| wiseowise wrote:
| All the people I know already participate on private boards. AI
| enshitification will only speed up the process of moving there.
| danielbln wrote:
| Are we using enshittification for everything we don't like
| these days? We invented calculators, those really
| enshittified manual arithmetic puzzles. Private boards for
| this stuff makes sense anyway, it's the Internet afterall.
| wiseowise wrote:
| Using LLM for this kind of thing is like using cheats or
| aim assist for online games. So yes, this is prime example
| of enshifittication.
| petercooper wrote:
| I think the intent is important. Using LLMs to do well on
| the public leaderboard is like using cheats/aim assist.
| But learning how to use LLMs to solve complex puzzles
| independent of any sense of "competition" is more like
| when people train neural networks to drive a car in GTA
| or something - it's not hurting anyone and it can be a
| real learning experience that leads to other interesting
| byproducts.
|
| But, yeah, don't use LLMs to try and get 9 second solve
| times on the public leaderboard, it's not in the spirit
| of the thing and is more like taking a dictionary to a
| spelling bee.
| ikesau wrote:
| enshittification isn't "things become worse" - it's the
| specific process of how services worsen in 3 stages:
|
| > Here is how platforms die: first, they are good to
| their users; then they abuse their users to make things
| better for their business customers; finally, they abuse
| those business customers to claw back all the value for
| themselves. Then, they die. I call this enshittification,
| and it is a seemingly inevitable consequence arising from
| the combination of the ease of changing how a platform
| allocates value, combined with the nature of a "two-sided
| market", where a platform sits between buyers and
| sellers, hold each hostage to the other, raking off an
| ever-larger share of the value that passes between them.
| ktaqhg wrote:
| No, we do not. Calculators are a whole different issue from
| LLMs, which plagiarize and spoonfeed whole paragraphs of
| thought.
|
| Enshittification occurs when previously good or excellent
| things are replaced by mediocre things that are good enough
| for those susceptible for advertising and group think.
|
| Examples are McDonalds vs. real restaurants, Disney theme
| parks vs. Paris, the interior of modern cars, search engine
| decline, software bloat etc.
| davidcbc wrote:
| Just the shitty things like using LLMs to spoil a fun
| competition
| andix wrote:
| It also doesn't make any sense for most of the people to
| compete with the geniuses on the public leader board. It's
| like signing up for the Olympics as an amateur athlete.
| Barrin92 wrote:
| The global leaderboard is so fast that any AI assistance would
| literally slow them down, here's one of the guys who tends to
| score highly solving today's puzzle. (https://youtu.be/ym1ae-
| vBy6g), and on the more complicated days that's even more
| pronounced because anyone who is even somewhat decent doesn't
| need to ask chatgpt how to write Dijkstra.
|
| Obviously if you're doing it recreationally you can cheat with
| AI but then again that's no different than copying a solution
| from reddit and you're only fooling yourself. I don't see it
| having an impact.
| Kiro wrote:
| The "winner" solved it in 9 seconds using AI so I don't
| understand how you can claim that.
|
| https://adventofcode.com/2024/leaderboard/day/1
| MattRix wrote:
| The thing is that the AI can read a puzzle faster than a
| human can. If someone put any effort towards an AI-based
| setup, it would easily beat human competitiors (well, up
| until the point the puzzles got too difficult for it to
| solve).
| petercooper wrote:
| I've always done AoC "properly" but this year I've decided
| to actually use it as a learning experience for working
| with LLMs (and I don't get up early so will never sully the
| leaderboard) and trying some experiments along the way.
|
| I think the strategy for the harder puzzles is to still
| "do" them yourself (i.e. read the challenge and understand
| it) but write the solution in English pseudocode and then
| have an LLM take it from _there_. Doing this has yielded
| perfect results (but less than perfect implementations) in
| several languages for me so far and I 've learnt a few
| interesting things about how they perform and the "tells"
| that an LLM was involved.
| anonu wrote:
| Python looks excruciatingly slow to me. If you want fast I
| believe you need to think and write in vector languages like
| kdb+/q. I am not a kdb+ expert by any means and my code can
| probably use more q primitives, but here was my solution in
| ~2 minutes: i1:("I I";" ")0: `:1.txt;
| sum {abs last deltas x }each flip asc each i1 / answer 1
| sum {x * sum x = i1[1]}each i1[0] / answer 2
| eddsolves wrote:
| That's cool, but horribly ugly! What does production kdb+
| look like? Is it similarly terse, maybe Perl-ish, or was
| this purely for speed?
|
| What does each flip asc do?
| anonu wrote:
| i1 is Nx2. asc each i1 sorts each N in ascending order.
| flip transposes to 2xN.
| vjerancrnjak wrote:
| Everything autocompletes in Python. from
| collections import * xys = list(map(int,
| open(0).read().split())) xs = xys[::2] ys =
| xys[1::2] xs.sort() ys.sort()
| print(sum(abs(x-y) for x,y in zip(xs,ys)))
| yc = Counter(ys) print(sum(((yc[x])*x for
| x in xs)))
| ctur wrote:
| Woohoo, one of the highlights of this time of year. I had to do
| mine from an eastbound flight over the pacific. This has become a
| fun tradition not just for me personally but for many friends,
| colleagues, and fellow HNers. Big props once again to wastl and
| his helper elves for making this!
|
| I encourage anyone who gets value from this to donate to support
| it if they can. It is a passion project but nonetheless comes
| with real costs.
| mteoharov wrote:
| > I encourage anyone who gets value from this to donate to
| support it if they can. It is a passion project but nonetheless
| comes with real costs.
|
| With the sheer amount of sponsors and AoC++ users I do believe
| that this is not quite a small 'passion project' struggling to
| pay the monthly subscription to a VPS.
|
| That being said, adventofcode is absolutely great and people
| should support it if they can. But I do think the author is
| doing quite well with the amount of support he is currently
| receiving.
| delta_p_delta_x wrote:
| Is there a way to override the CSS (on Chromium)? The body font
| and weight, Source Code Pro is far too thin and far too wide and
| gives me a headache (and has regularly turned me off AoC). I'd
| like to change it to `sans-serif`.
| delta_p_delta_x wrote:
| Self-response: Stylus is useful here[1]. There is a list of
| already more readable styles than the default that the
| community has prepared.
|
| [1]: https://github.com/openstyles/stylus
| 9029 wrote:
| I have used Stylus for CSS tweaks:
| https://addons.mozilla.org/firefox/addon/styl-us/
| riffraff wrote:
| On thing you can do is fetch the html and extract the main
| content to display it in your favorite way, it's been stable
| for years, and you can use the (stable) session_id cookie, it's
| how many people approach the challenge.
| GCUMstlyHarmls wrote:
| You can hit the "Reader" button on Firefox (ctrl-alt-r), I
| think Chrome also has that? Or an extension that does the same
| thing would probably work.
|
| Bit simpler than writing an override or fetching the HTML.
| babo wrote:
| There are CLI tools to fetch and submit solutions. At least one
| of them allows you to download the puzzle description as
| markup: https://github.com/scarvalhojr/aoc-cli
| mcintyre1994 wrote:
| I'd just create a bookmarklet or run JS in devtools:
| `document.body.style.fontFamily = "sans-serif";` etc
| bernds74 wrote:
| Nice to see that traditions are upheld, such as the unreadable
| font and colors.
| simonjgreen wrote:
| And the timeless tradition of HN commentators cynicism
| MortyWaves wrote:
| And the timeless tradition of criticising perfectly valid
| concerns. Not everyone wants to be a member of the dark mode
| lobby.
| block_dagger wrote:
| And the timeless tradition of HN commentators contempt
| moffkalast wrote:
| Wouldn't have it any other way :)
| arp242 wrote:
| I had to fiddle with the colours in the web inspector to even
| read the page. So yeah...
|
| Of all the cynical comments I see on HN, this ranks very very
| low.
| matsemann wrote:
| Reader mode or "View -> Page Style -> High contrast" in
| your browser works perfectly fine.
| delta_p_delta_x wrote:
| Reposting a comment below: I used Stylus[1]. There are already
| some considerably more readable themes by the community.
|
| [1]: https://github.com/openstyles/stylus
| bberrry wrote:
| Personally I love the esthetic and hope they never change it.
| lpapez wrote:
| It's a simple webpage. If you don't like it, you can customize
| the CSS with a few custom rules in your browser.
| xPaw wrote:
| Yeah, I made a userscript for myself to fix that up:
| https://gist.github.com/xPaw/4fffaf776fe14d15c9602991f51dbfa...
| matsemann wrote:
| I love AoC. You don't have to care about the AI bots solving it
| or people waking up earlier than you, just solve it for your own
| fun. Either because you like the challenges, or to try it in a
| new language etc.
|
| I like to do them in a functional style in Kotlin as far as
| possible, as that's different from what I do at work.
|
| Edit: Here's mine from today, with my utils it's not exactly
| plain kotlin, but part of the fun is building a library of sorts
| with cool functions https://github.com/Matsemann/algorithm-
| problems/blob/main/ad...
| c-fe wrote:
| Nice one, i like your transpose function, as python-numpy user
| in past years, but kotlin this year, i really missed the
| transpose function the most for this day one. My code:
| https://github.com/charelF/AdventOfCode/blob/main/kt/src/y20...
| matsemann wrote:
| Unzip was nice, will remember that one!
|
| This is also what I like, reading other's solutions and
| learning new stuff. I browse the subreddit after solving it
| myself to see all kinds of cool approaches.
| librasteve wrote:
| other advents are available...
|
| https://raku-advent.blog/2024/12/01/day-8-rendering-down-for...
|
| https://news.ycombinator.com/item?id=42286954
| Enk1du wrote:
| and more advents...
|
| https://pdl.perl.org/advent/index.html
| librasteve wrote:
| yes perl was the original advent of code iirc
| sundarurfriend wrote:
| I was looking for a puzzle in the first link until I saw the
| home page: "One article on Raku per day, until Christmas." I
| vaguely remember these from my Perl days (a decade ago) now.
|
| AoC usually loses my interest around day 6 or so, but a PDL
| journey for the advent sounds a lot more appealing. Time to
| dust off my Perl skills and see if I find it as fun today as
| I did back then.
| ArcHound wrote:
| I love AoC. I made a CLI client in python for me (and a lib for
| common tasks, especially the 2d grid maps).
|
| Repo: https://github.com/ArcHound/advent_of_code Writeup:
| https://blog.miloslavhomer.cz/p/advent-of-code-cli-client-an...
|
| Good luck to y'all in 2024 and enjoy!
| peanut-walrus wrote:
| I love AoC, but I hate the timing. December is always the busiest
| month of the year, so I really almost never find the time for it
| :(
| criddell wrote:
| You don't have to do it in December. I was still working on
| last years in March.
| NamTaf wrote:
| I've never done AoC but I've done other programming-related
| challenges before. I come from a non-IT background (mech eng),
| and I'm currently away for work for the first several days with
| only their locked-down laptop.
|
| Normally I'd break out Python for this, but given the constraints
| maybe I should try to see how far I can get through this in
| Excel. It'd be a fun little challenge :)
| andai wrote:
| My approach here would be to make an index.html file with a
| script tag and drag it onto whatever browser is available. Then
| again I have made peace with JavaScript!
|
| (I think you could even use typescript with this method with
| the on the fly babel transpiler (you just include a script tag)
| but I haven't tried that.)
| cube00 wrote:
| You'll lose the benefit of the TypeScript compiler picking up
| mismatched types if you only use a transpiler.
| Cruncharoo wrote:
| I use Excel for the first few as well! I actually find it to be
| easier than using Python/Javascript, at least early on.
| ducdetronquito wrote:
| I will try to do it with F# and Gleam this year, but like every
| year I won't have time (and brain) to do more than 10/12 days ^^
|
| For the pythonists around here, give F# a try: it can feels very
| close to scripting and it has a wonderful REPL too :)
| andrelaszlo wrote:
| How's linux support? :)
| neonsunset wrote:
| If almost 9 years were not enough to make this question seem
| silly, perhaps DuckDuckGo/Kagi/Perplexity could answer this?
| plagiarist wrote:
| Sure those can answer it. That person is perhaps trying to
| be social on a social network by inviting comments instead?
| neonsunset wrote:
| This specific question posed in this specific way usually
| implies a negative interaction. I have seen maybe one
| exception here so far.
|
| And after providing detailed answers for so many times, I
| don't think it's worth it.
| samatman wrote:
| You guaranteed it would be a negative interaction when
| you negatively interacted with the post. You're allowed
| to skip the ones you don't want to reply to.
| davidgl wrote:
| Perfect, run loads of f# and c# on Linux, and have for years
| ducdetronquito wrote:
| Works like a charm for me with Ubuntu 24.04/VSCode/Ionide (F#
| extension) !
|
| For AoC I don't use a real project setup, just a `dayX.fsx`
| file and I run it like a script with `dotnet fsi dayX.fsx`,
| et voila :)
| axpy906 wrote:
| I am doing it in bash. Will see how far I can go!
| thaliaarchi wrote:
| I'm continuing my tradition of doing AoC in Whitespace[0]. The
| first year I did it, it was motivation to build out a standard
| library so things wouldn't be so tedious. Now, I find myself
| wishing I had finished better tooling. I debug with wsjq[1], a
| CLI debugger like gdb written in jq, but it's slow.
|
| [0]: https://github.com/thaliaarchi/ws-challenges
|
| [1]: https://github.com/thaliaarchi/wsjq
| ssernikk wrote:
| I've done last two AoCs in F# (well, only the first few days
| too). For a person without prior functional programming
| experience, it was fun! Unfortunately I won't have time to
| participate this year, but if I did, I'd probably chose F#
| again.
| neonsunset wrote:
| I can't explain why but doing AoC is always interesting, and
| doing LeetCode which is supposed to be similar is always very
| depressing.
|
| Wishing everyone a fun challenge. This year I will be practicing
| F# and hope some of you will give it a try too :)
| https://github.com/neon-sunset/AOC24/blob/master/day1.fsx
| andai wrote:
| That's actually a very important question I think, and sorely
| neglected by most educators! (and book authors, etc)
| sailorganymede wrote:
| AoC would be more stressful if you had to solve a problem in 30
| minutes for a highly competitive job.
| acomjean wrote:
| those exist. except I think the one I did was an hour(? it
| was ten years ago). I got the interview, but that didn't go
| well, so I went to work elsewhere.
|
| they have part of the site that has lessons for developers:
|
| https://app.codility.com/programmers/
|
| I haven't used it for a long time, but they also have
| contests with some small prizes:
| https://app.codility.com/programmers/challenges/
| foooorsyth wrote:
| The Christmas theme is fun and it's nice to do one problem per
| day with a large community.
|
| With leetcode you're off in the woods by yourself. Stuck on a
| problem? Here's a cold write up. Finished a problem? Do
| another, monkey.
| kadoban wrote:
| The community is most of the difference. That and the problems
| aren't very similar to leetcode.
| BitterAmethyst wrote:
| I'm also doing them in F# (again). Hoping to best my past
| attempts, never gone beyond day 12 before!
|
| I'm never gonna do it fast but I enjoy using fparsec to get the
| input text in whatever format I need each time, even if writing
| and debugging the parsers sometimes takes up way too much of my
| time!
| jacamera wrote:
| Have you ever tried the LeetCode live competitions? I found
| those to be really fun with a great community. Just grinding
| problems in isolation can definitely be depressing.
| sigbottle wrote:
| Think it's because certain topics, such as dynamic programming
| or graph algorithms, are just not something you can attack from
| first principles for most mortal people. I certainly wouldn't
| have invented binary trees. So there is quite a bit of things
| to read up on (though it should all be covered in an algorithms
| course).
|
| Then once you do get that context... like LeetCode problems
| often aren't very inspiring? A lot of the time it's "just apply
| this technique here".
|
| Whereas in AoC, at least in the first few weeks, it's mostly
| just, do the task, attack it from first principles.
| criddell wrote:
| > You don't need a computer science background to participate -
| just a little programming knowledge and some problem solving
| skills will get you pretty far.
|
| The use of "pretty far" gives them a bit of an out, but I think
| this statement is a little disingenuous. Last year, at least, a
| bunch of the problems needed fairly sophisticated algorithms to
| find the solution in a reasonable amount of time.
|
| To me, a little programming knowledge is what somebody who is six
| weeks into their introduction to programming class has. They know
| variables, loops, lists, and maybe associative arrays.
| wenderen wrote:
| Anecdote to support your comment: The Chinese Remainder Theorem
| has featured in Advent of Code at least twice IIRC. Not an
| algorithm the average programmer (average is a very fuzzy term,
| yeah) would know.
| Jtsummers wrote:
| > The Chinese Remainder Theorem has featured in Advent of
| Code at least twice IIRC
|
| Fortunately it's never been needed. Every time it's come up
| the problem has been solvable with high school algebra level
| math skills (you need to know what the lcm is and that's
| covered in middle school in many places). If you knew the CRT
| you could jump straight to a solution, but a solution was
| easily derived using algebra and a couple loops.
| kadoban wrote:
| "Participate" doesn't mean "win". You can look things up as
| well. I haven't done a ton of AoC, but the harder ones from it
| I've seen were not very hard to search/research for the correct
| algorithm (even avoiding "what's the answer for day X"
| searches).
| seba_dos1 wrote:
| AoC doesn't require any particular algorithmic knowledge to
| solve its problems. Sometimes knowing algorithms is useful to
| quickly write your solution, but IME it's never a requirement.
| Unlike leetcode-style challenges, AoC tasks usually don't even
| try to punish you for solutions that are specific to your
| particular input. You can get some stars with just pen and
| paper.
|
| It's more like a set of logic puzzles. Programming and
| algorithms are only incidental.
| NoelJacob wrote:
| Other challenges (in advent and not in advent) like advent of
| code:
|
| https://github.com/NoelJacob/advent-and-other-calandars Compiled
| by myself.
| smcl wrote:
| Not a challenge, but it may be of interest anyway - Sergey
| Tihon's F# Advent Calendar:
| https://sergeytihon.com/2024/10/26/f-advent-calendar-in-engl...
|
| I think there's a few of these for different languages/tech. I
| think they may be good for HN'ers seeking some kind of little
| daily advent-y fix without the potential emotional/mental
| investment of AoC.
| MortyWaves wrote:
| That's an impressively broken website on mobile. Really, I
| haven't seen a site I wasn't able to scroll horizontally
| before.
| remram wrote:
| This is great, thanks! I usually do AoC to learn a new
| programming language but there's no more language I care to
| learn right now.
| rikroots wrote:
| Do you want to add Genuary to your list? A month of daily
| prompts to get you producing some generative / creative coding
| art. Starts Jan 1. Website here: https://genuary.art/
|
| I've promised myself that one year I will move beyond the first
| seven prompts ... who knew creativity could be so taxing?
| atribecalledqst wrote:
| Last year I got stuck on Day 12 for a full week, and thinking
| about how to solve it consumed my every waking moment. I think
| this year, I'm going to be kind to myself and not participate so
| I can really enjoy the winter break from work.
| orra wrote:
| Sounds sensible. It's important to set boundaries, and enjoy
| time off.
|
| For me Advent of Code is a slippery slope. The difficulty ramps
| up so at first it's easy, then it's rewardingly difficult. But
| then before I know it, it takes wayyyyy too much time. The
| danger is being emotionally invested by then.
| matsemann wrote:
| There's a graph here of the "hardness" of each day/task,
| based on how long the 100th place on the leaderboard used.
| https://aoc.xhyrom.dev/
|
| So it's not linear, and also based on your own knowledge. So
| perfectly fine to skip some days and still it's possible to
| solve some of the next ones!
| ruuda wrote:
| Cool, it would be nice if that one aligned the days which
| were on weekends, as those tend to have harder problems.
| SketchySeaBeast wrote:
| If I understand correctly, and I'm not sure if that graph
| proves that, they try to put longer puzzles on weekends.
| wjholden wrote:
| Right, Eric Wastl addresses exactly this in his talk. He
| considers weekends and burnout in the pacing of the
| event. I think this is the right video:
| https://youtu.be/bS9882S0ZHs
| schneems wrote:
| > So perfectly fine to skip some days and still it's
| possible to solve some of the next ones!
|
| You try telling that to my brain. That guy doesn't listen
| to me.
| tg180 wrote:
| This is why I usually do the simpler ones and then
| stop... Otherwise, I just can't skip, it's stronger than
| me.
| torginus wrote:
| Ugh, I hate log scales used arbirarily, every silicon
| valley nerd things it makes them cool like their EE profs
| teaching actual science or Ray Kurzweil singularity
| whatever nonsense.
| dahart wrote:
| Ray Kurzweil is indeed full of crap (I have a specific
| bone to pick with his intentional mis-use of life
| expectancy among other things), but what makes you think
| in this case the use of log is arbitrary? Did you look at
| the data with a linear axis? I just tried it, and the
| vertical space is dominated by 4 or 5 outliers, and on
| top of that you can't see the trend as well when it's
| linear and all the data is smooshed at the bottom. Log
| plots are great when your values span many orders of
| magnitude. That's true in this case, and the log plot
| both uses less vertical space, which is nice, and it more
| clearly shows the trend and wastes less empty space on
| the small minority of outliers.
| roncesvalles wrote:
| There are some "filter" days for sure, usually those are
| when the solution needs a major leap in your approach such
| as concurrency, dynamic programming, or geometry equations.
| abound wrote:
| It's usually not concurrency FWIW, it's almost always
| algorithmic in nature. On a modern machine, even highly
| concurrent* code would only execute 10-20x as fast and
| you could just wait a bit.
|
| One common AoC trick is that you can brute-force part one
| (e.g. O(n^2) complexity or worse), but part two scales up
| `n` to make that intractable.
|
| *ignore my sloppy conflating of concurrency and
| parallelism
| Jtsummers wrote:
| I agree with you. I don't think either concurrency or
| parallelism have ever been necessary. In 2019 with
| Intcode, it was the _simplest_ approach (use multiple
| threads, one per VM) for a couple days, but it was never
| actually necessary. You could do the same thing with
| purely sequential code, but you had to juggle the state
| of multiple running systems yourself then. Threads were
| much easier (or coroutines, go routines, processes, etc.;
| some concurrency system).
|
| And by design, every problem is solvable on decade old
| computers in a reasonable amount of time (seconds) so
| parallelism is great if you're looking to minimize the
| runtime, but it's never necessary.
| mvdtnz wrote:
| For those just glancing at the chart do note the scale is
| logarithmic, so the difficulty increases exponentially.
| kwertyoowiyop wrote:
| Either the problems are getting easier each year, or
| perhaps there are just more people participating which
| drives down the 100th-place times.
| tails4e wrote:
| I usually make it Monday 18 or 19 and then I loose the will
| as the time taken is excessive, and obsessing about it is not
| good. I've finished a 5 years, but all after the fact. Some I
| am not sure I'll ever finish....
| smcl wrote:
| Ah yeah I've been there! Having done it a few years now, I've
| found that the approach that works for me is: if it starts
| looking like I'll be stuck on one for more than a few hours,
| I'll skip it and move on. Otherwise I'll accumulate an
| insurmountable backlog that becomes more of a depressing chore
| to think about, than a fun little christmas tradition. I'd
| rather have a _mostly-complete_ set of problems by the end of
| the year that I can come back and clean up when I feel like it.
|
| That said, if you'd have a better holiday season by just
| stepping back from the computer and relaxing then that sounds
| great too. Either way - enjoy!
| chucksmash wrote:
| My main complaint the last time I did this (2022) was the
| havoc it wreaked on my sleep schedule. Advent of Code is not
| kind to East Coast participants.
|
| Every year except for one has been kind of the same pattern
| for me:
|
| Day 1: this year, I'm just going to solve the problems. No
| futzing around.
|
| Day 3: but it would be kind of neat to turn the solutions
| into a reusable AoC library. Just something minimal.
|
| Day 5: and I should really add a CLI harness for retrieving
| the problems and parsing the input files.
|
| Day 6: and testing of course.
|
| Day 7: maybe I'll skip today's problem (just for today) and
| keep improving the framework.
|
| Day 358: oh neat, Advent of Code is coming up.
| smcl wrote:
| I'm in CET so time-wise it can be ok - problems open at 6am
| meaning if I get up I have about an hour around before I
| need to walk my walk my dog and get ready for work. But
| switching on at that time is really hard, the amount of
| stupid off-by-one errors, or referring to since-renamed-
| but-still-present functions in my Jupyter Notebook is not
| even funny.
|
| But I luckily managed to avoid the "reusable AoC library"
| problem around 2019 when a week beforehand I wrote down the
| sort of functions I wanted to have at my disposal (usually
| things around representing 2D/3D grids of unknown size and
| pathfinding/debugging therein, but a few other bits and
| pieces) and made a simple library that I will sometimes add
| things to after I'm done with the problem for the day.
|
| I was tempted to some functions (similar to those your CLI
| harness provided) for retrieving test data and submitting
| answers but I managed to stop myself short of that! But I
| am sure you're far from the only one to end up down that
| road.
| beacon294 wrote:
| What if you don't get up?
| Kwpolska wrote:
| I'm in CET too, and 6:00 is not an hour where I'm awake,
| and if I were, my brain functions would definitely not be
| at a level where I would be capable of coding.
|
| Midnight would be much more acceptable.
| Vivtek wrote:
| Stay out of my head!
| pvinis wrote:
| A friend recently shared this with me. I think you'll like it.
|
| https://eli.li/december-adventure
| oweiler wrote:
| I will probably solve the first 7 puzzles like every year and
| then just stop.
| rikroots wrote:
| This is my experience. After the first week I develop an
| intense hatred of all things Elf and start swearing at my
| laptop. At which point I give up to stop my mental health
| deteriorating any further.
| danielovichdk wrote:
| Hahaha...I love this comment. I have just been stuck for a week
| doing edge puzzles and backstepping recursion, keeping myself
| awake aye night because it bothered me I couldn't "just" solve
| it.
| ryukoposting wrote:
| Likewise. I did it one year in college and it became a life-
| consuming thing almost immediately. Not AoC's fault - part of
| it was depression, part of it was the Minnesota winter. Now
| that I have a full-time job and a wife, I'm trying to be more
| careful with those things that I know will suck me in.
| JackMorgan wrote:
| All things in moderation! Now if I can just make it through the
| winter without installing the new Factorio DLC...
| mrwww wrote:
| this comment actually prompted me to finally download and
| install the factorio demo, been hearing so many things about
| how it takes over lives! :)
| hollerith wrote:
| So, you _want_ it to take over your life?
| JackMorgan wrote:
| It really is such a great game! I got the base game, beat
| it a few times, then my partner and I played a few mods,
| currently in an Angels+Bobs playthrough. So much replay
| value
| Tyr42 wrote:
| I've been playing half an hour each morning before the rest
| of the family wakes up. Just finally made it to the volcano
| world
| SketchySeaBeast wrote:
| It ate my life for a few years in a row, I even managed to
| finish on Christmas eve twice. Now I don't even look, it turns
| from fun to stress rather quickly.
| moomin wrote:
| Only year I ever completed it it took eight months.
|
| I'm not seeing my name on a leaderboard any time soon.
| SketchySeaBeast wrote:
| Oh yeah, me neither. The competition is far too intense.
| What takes me hours takes the competitors minutes.
| ljm wrote:
| I re-read the intro and the fact it mentions leetcode and the
| like was enough for me to decide that it's an ultimately
| pointless endeavour for me.
|
| I have no interest at all in competitive programming or
| maths; I spend 40+ hours a week doing programming for work, I
| want games and challenges that pull me away from that so I
| continue to have a life outside of my job.
| ipdashc wrote:
| For what it's worth, I _hate_ leetcode with a burning
| passion, have no real interest in math, and yet I
| personally find Advent of Code quite fun and enjoyable.
| dunham wrote:
| I have found AoC fun, but on some of the later days time
| constraints make it a little stressful (full time job +
| kids constrain my time).
|
| I've done it (and completed it) the last five years. I
| used it to try out a few languages (Haskell, Idris, Lean)
| and did it in python one year I was feeling lazy. I've
| got a project going now, and I probably should do that
| instead.
|
| However, that project is a programming language, so this
| is a way to test practicality. But solving problems and
| fixing shortcomings in the underlying language at the
| same time may be a bit too much. (It's a dependent typed
| language, so there is a lot of subtlety to deal with.)
| pxx wrote:
| this strat won advent of code in 2022.
| https://blog.vero.site/post/noulith
| codr7 wrote:
| Same, I've been coding for 40 years and I still learn
| plenty every year.
| ehsankia wrote:
| I find it useful for trying new languages. The first 10
| days usually start very easily and progress quite
| gradually. The 2nd half definitely gets more brutal, but if
| you do have the self-control, you can stop whenever it
| stops being productive.
| pjot wrote:
| I love it for these meta-type use cases that aren't
| necessarily about solving the puzzles.
|
| For instance I'm using it this year to dial in new neovim
| configs. Last year was to get comfortable with a split
| keyboard.
| sureglymop wrote:
| How about something creative that is at the same time
| relaxing?
|
| Some time ago I started creating mods for the game stardew
| valley. It still involves some programming but mainly
| drawing, creating animations and composing music! It's an
| absolute blast and so relaxing (like the game itself).
|
| I think by now I could even start working on my own game
| but I don't yet have a desire to.
| whoodle wrote:
| Not OP, but that's really neat. What's your process for
| that? What IDE for the coding? Is C# required? What
| software for the art?
| sureglymop wrote:
| I started with something called ContentPatcher. It let's
| you patch game assets and other stuff (including some
| logic) using a json based DSL.
|
| For more complex things C# is needed as Stardew Valley is
| made with XNA/MonoGame. There is a NuGet package to set
| it up which even includes hot reloading of the mod into
| the running game: https://www.nuget.org/packages/Pathosch
| ild.Stardew.ModBuildC...
|
| I use NeoVim but you can use any editor. It was a bit of
| a pain to get dotnet going on arch linux but I got it
| working after some tinkering.
|
| To get started, one can install SMAPI, then unpack the
| game assets. Then, you can open game maps and assets in
| the Tiled level editor. I also use Aseprite to make the
| pixel art tilesets for the maps (LibreSprite would also
| work). I use a mix of my own tiles and tiles from the
| game itself for my maps. Music and sound can also be
| added or patched with ContentPatcher. I make all sound
| related stuff with Ableton Live. I haven't done much with
| C# yet but SMAPI provides a pretty nice API so it should
| be pleasant to use.
| Twirrim wrote:
| I go in to this not caring how fast I do it, or how far
| behind I get. It's just an opportunity to learn something
| and challenge myself a little bit.
|
| At best, I tend to set myself an upper limit for runtime.
| keybored wrote:
| I have enough fun side project ideas that I want to do.
| Ones which will also be helpful for me once I'm done with
| them.
| alach11 wrote:
| I just do the puzzles until it stops being fun. For me that's
| usually around day 14.
| brightball wrote:
| We run a private board for Advent of Code for the Carolina Code
| Conference. Eligibility for prizes starts after earning only 10
| of 50 possible stars precisely for this reason.
| flanbiscuit wrote:
| Oh cool. I live in WNC and had just missed your last
| conference in August. Is it possible to join multiple private
| boards? I usually do one with my coworkers as well
| sokoloff wrote:
| You can only "own" one board, but you can join many.
| brightball wrote:
| Yep. I'm running a little behind but the announcement will
| come out later today on our site/email list.
|
| https://carolina.codes
| alach11 wrote:
| That's awesome. We do the exact same thing for prize
| eligibility on my work leaderboard. The whole point is for it
| to be fun and challenging. No need to grind to the end unless
| you want to.
| bmitc wrote:
| One reason I didn't enjoy it was that I felt the days don't
| build on each other well. So you get little code reuse. It was
| continually changing requirements, so it was especially like
| work.
| Jtsummers wrote:
| In 2019 he built up about 12 challenges using a VM, for
| Intcode, you had to construct. It was poorly received because
| without a working version (developed over the first few
| Intcode challenges), you couldn't solve the rest of them. He
| hasn't done anything like that since, though I thought it was
| probably the more interesting series of challenges.
|
| The problem with continuity across days is that the later
| days can be blocked by the earlier ones, as they were in
| 2019. That partly defeats the purpose (or structure) of the
| challenge, where you can mostly pick any day and try it
| without regard to earlier days or prior years.
| hoistbypetard wrote:
| I agree. Intcode was fun, but completely destroyed the
| promise of skipping a day and still having fun with later
| puzzles. I didn't come to enjoy it until much later.
| wjholden wrote:
| I agree that it wasn't completely well-received, and I
| think this is a real shame. The stated goal of Advent of
| Code was always to make better programmers. Extending,
| maintaining, and testing large systems is an important part
| of real-world engineering efforts.
|
| I thought the IntCode thing was great and I hope to see
| something like that again this year.
| timeon wrote:
| People are skipping days? I usually drop out when I'm stuck
| on some day. 2019 was my favorite.
| smrq wrote:
| There's a lot of potential code reuse between years; whether
| that's good or bad is up to you, I think. (I would personally
| prefer if my Chinese remainder theorem solving function got
| _less_ use, but it seems to be called for every year or two.)
| adventofshmode wrote:
| I got stuck on the graph-cut puzzle for FOUR MONTHS. I had to
| write a force-directed graphing engine to find the longest
| three edges to cut.
|
| After I solved it I looked at other people's solutions and they
| used Meta's proposition solver in about 10 lines. Seemed like a
| massive cheat to me.
| moustachehedron wrote:
| Oh man, this is my best memory of last year's AoC. After
| uselessly noodling for a while, I used Graphviz to draw the
| graph to an SVG file. It drew two messy balls of yarn neatly
| connected by three edges.
|
| My script still says "TODO: find a real solution". Good
| times.
| jjnoakes wrote:
| I have a self-imposed goal of not using third-party libraries
| for any of the solve logic. It feels more satisfying to do it
| myself, even if it takes longer.
| wjholden wrote:
| What solver are you referring to? I've used z3 and OR-tools,
| but I find it so difficult to model problems in either one
| that I seldom get good usage of either one.
| rak1507 wrote:
| What's so hard about Day 12? It's just
| +/'{x:".",x;H:(-1+;1+i-)@'+|\m*i:!#m:x=\:"#." R:(x=x)(
| {[h;d;x;y;z](z#0),+\(((-z)_~"#"=x)&z_d>z)*(*y),(-z+1)_y-0^y h}.
| H)[x]/y
| (*|R)-R@*|0,&1_*+m}.''1({("?"/:5#,x;,/5#,y)}.')\@[;1;.:]'"
| "\:'0:`:i/12.txt
| Jorge1o1 wrote:
| Is this Q? or k?
| icen wrote:
| Looks like K to me!
| rak1507 wrote:
| It's k4, the underlying language behind Q. With slight
| modifications it also runs in ngn/k which is FOSS.
|
| https://ngn.codeberg.page/k/#eJxVjsFugzAMhu95iiyWik1CIGPtIV
| G...
| meisel wrote:
| This is what programming languages looked like to me before I
| learned programming
| gcanyon wrote:
| Any idea how close that is to valid J code?
| globular-toast wrote:
| The year I did it I got lucky and solved them all within a
| reasonable amount of time until there was one that suddenly
| involved a lot of nontrivial linear algebra and I immediately
| spotted that this wouldn't be fun and noped out. Noticed the
| number of people solving dropped off a cliff on that day.
|
| I think as nerds we need to be quite careful not to get too
| drawn into this kind of thing. Sometimes it's like a
| superpower, but other times it just pointlessly consumes your
| life. Kinda makes me think of gambling addiction: "when the fun
| stops, you stop".
| 9witz wrote:
| You can also set a time rule. For me it's 45min, if it takes
| longer to solve it, I an allowed to quit.
|
| It's totally worth it, though, especially for the first week,
| when you look up how other people solved the thing you just
| solved. I always learned (or re-learned) something from that.
| IMHO there's not that much value in looking up solutions
| before you solved it yourself, though.
| anonzzzies wrote:
| I just have them lingering in the back of my brain the whole
| year. I solved the last one from last year a month ago. This is
| much nicer than sudokus or whatever: I sometimes dream about
| them and I keep finding better (in my mind) solutions for ones
| from years ago. It's lovely when you sit at another dumb crap
| meeting/standup so you have something to do in your head.
| nja wrote:
| > I can really enjoy the winter break from work
|
| What line of work are you in that you can take a winter break,
| and furthermore, that you can actually not work during that
| break? I'm envious...
|
| I've always wanted to do AoC but on top of work it is too much.
| atribecalledqst wrote:
| I get the week between Christmas and New Year's off and then
| I take a bunch of my PTO in December. It's not an official
| break or anything.
| __loam wrote:
| Lots of people (in tech at least) take time on top of
| mandatory vacation that can result in like 2 weeks of time.
| istjohn wrote:
| Heh, I just checked. That's where I got stuck last year, too. I
| solved the first half.
| orra wrote:
| I would love it if the first star of the day was required, but
| the second was a bonus. I love Advent of Code, but I don't have
| the time to get 50 stars.
| andix wrote:
| No stars are required at all. You can also skip some days if
| you don't want to do them. Or only to the first stars. However
| you like. First/silver stars will also increase your score in
| the leader boards.
| 4hg4ufxhy wrote:
| I think you need all stars to do the final puzzle.
| andix wrote:
| That might be true, I've only completed it once a few years
| ago. But if you don't want to the more complicated parts,
| then you want to skip the last one for sure.
| lancebeet wrote:
| I might be mistaken but I believe the final day has only
| one puzzle, but the 50th star (a.k.a., the second star of
| December 25th) is given for having solved everything else.
| I don't think any puzzles are "locked".
| SketchySeaBeast wrote:
| You're right. The second star is a freebie for completing
| the rest.
| linhns wrote:
| Same. Especially when it gets really hard later on. Despite
| studying CS, I still struggle with it.
| setopt wrote:
| The tiny thin gray font on black background is impossible to read
| on a mobile device :(
| MattRix wrote:
| On iOS you can switch to Reader view, and I imagine Android has
| something similar.
| technofiend wrote:
| Yes on Android it's already readable in Firefox, but that may
| be due to ad-blocking plugin. Even so, Firefox reader mode
| makes it even better.
| goodlinks wrote:
| *browser not os feature :)
| 0xEF wrote:
| Color aside they also ignore a number of solutions for font
| resizing that follow the users accessibility settings. I can
| think of at least three easy ways to do this with html/css
| alone, and yet hear we are; a site that is unreadable to me.
|
| I love what Advent of Code does, but when your site is all
| text, there's just no excuse to not let the user resize it by
| default.
| scrivna wrote:
| AoC day one challenge... make website responsive
| sebtron wrote:
| It is terrible for me on my desktop too :(
| SleepyMyroslav wrote:
| Am I alone in thinking that measuring time to get answer is the
| worst possible metric? I have not participated because of that
| (yet).
|
| If there is a community for those who use other rules to compare
| actual solutions instead of answers I would be interested to hear
| about it.
|
| I am coming from low level C++ gamedev side so I understand that
| most people here use different tools to solve different problems.
| dingensundso wrote:
| I think most people don't participate for the competition. I
| did it several times to increase my coding skills, have fun or
| get more practice in a new programming language.
| SleepyMyroslav wrote:
| It is normal for coding to seek feedback from others to your
| solution. Even if it is automated. Looking at 'competing'
| solutions after you spent time on yours can teach how others
| think. Improving code after you learned new facts is huge
| part of coding fun at least for me. People mentioned private
| leaderboards in the topic few times. I just don't think time
| to submit an answer is relevant.
| anon22981 wrote:
| Why do you care about the time so much then? Just ignore it
| :D
| Levitz wrote:
| Can you propose other metrics that don't involve executing
| stuff in a whole lot of languages? The point is to let people
| work in whatever they want, as only the solution matters. If
| only the solution matters I don't really see other options
| beyond time.
| kibwen wrote:
| Here's a website that appears to be about competing on the
| performance of each solution: https://codspeed.io/advent
| SleepyMyroslav wrote:
| >Participants have 36 hours
|
| Looks like it is for young people who have dedicated time for
| it everyday.
|
| Personally I would like to do anything like this with no time
| limit and probably no monetary prizes. I think the only value
| of those puzzles is to fire up rarely used neurons that
| hopefully are still there after another year of shipping
| corporate products xD. I might appreciate fresh point of view
| from young people and new programming languages though.
| _se wrote:
| Because only young people can make time for things.
|
| There are plenty of professionals with jobs and families
| making time for AOC because they enjoy it. Doing the
| problems at the same time as everyone else is a VERY
| different experience from doing them whenever you'd like.
|
| If you don't want to make the time for it, power to you.
| I'd recommend most people to drop off after the first 10ish
| days. But don't delude yourself by ascribing this as the
| domain of "young people" or those without responsibilities.
| You're making a decision. Own it.
| SleepyMyroslav wrote:
| I appreciate your perspective and it is correct. I should
| have phrased it differently.
|
| Imho: I worked with code that has long history for my
| entire career. If the goal is to look at some objective
| quality of solution then I do not believe in time limits.
| The longer I work the more things getting
| patches/updates/remasters and value of better code goes
| up and value of arriving at any kind of solution
| overnight goes down.
| _se wrote:
| For software that's meant to be maintained for long
| periods, especially by others, I agree with you.
|
| The thing about AOC is that it's really less about the
| code that you generate, and more about the process of
| solving the problem. The challenge is really what you
| make of it. Some people will golf it, some will go for
| speed, other for performance, etc.
|
| That's why it's so different to solve the problems in
| "real time". There's a huge community of people solving
| the same problem that you can interact with and bounce
| ideas off of. Even just a few days after the problem is
| released, most of that active discussion has dried up, so
| you can no longer participate in that discourse.
|
| So, again, I don't think there's anything wrong at all
| with what you're saying, but there are other elements to
| consider beyond maintainable code and pristine solutions.
| criddell wrote:
| > Doing the problems at the same time as everyone else is
| a VERY different experience from doing them whenever
| you'd like.
|
| I agree and I happen to think the experience of doing it
| later than everybody else is significantly better. If I
| search for "AoC 2024 day 12 hint", I'll get better
| results on Jan 12 than Dec 12.
| o_bender wrote:
| Then you may like https://highload.fun/ No time limits, no
| monetary prizes, fastest solutions win.
| Jcampuzano2 wrote:
| The vast majority of people are doing it for fun or learning
| purposes and not to compete on the leaderboard, and it wouldn't
| quite be fair to compare much else in a competitive setting but
| time of completion and correctness, since you'd be at a
| disadvantage just by language choice in many other metrics.
| Unless you are someone with experience competing in competitive
| programming you almost certainly won't make the leaderboard
| anyway.
|
| If your goal is to compare solutions, lots of that happens on
| the subreddit for it where people post solutions in their
| language of choice on the daily threads.
|
| I just do it for fun. When I was younger I'd actually do them
| at release (11pm in my timezone), now I don't even bother and
| just used them as sort of a brain teaser to start my days and
| compare with coworkers who also do it, a lot of us in different
| languages.
| clbrmbr wrote:
| It could be interesting to find the shortest solution. But the
| site is not set up for verifying solutions in various
| languages.
| criddell wrote:
| I wouldn't use an AI to solve the problems, but I wonder if an
| AI could give good feedback on a solution I cook up?
| yoyohello13 wrote:
| That's what I've been doing with some older AOC puzzles. I
| solve it, then paste my solution into Claude and ask for tips
| on making it more idiomatic. It's been pretty nice so far. I
| learned about Haskell Arrows which I would probably have
| never come across otherwise.
| nikanj wrote:
| That's like saying you don't want to go for a run, because
| professional marathon runners are so focused on time
| sebtron wrote:
| I also don't like it, last year we had a private leaderboard at
| work and I realized being crazy enough to wake up at 5:50 every
| and solve at least part 1 would give me an edge. But the "wake
| up at 5:50" part is what I enjoyed the least.
|
| However, there are other ways to rank yourself against others.
| You can order your private leaderboard by number of stars, or
| make your own leaderboard using their APIs.
| mhitza wrote:
| > If there is a community for those who use other rules to
| compare actual solutions instead of answers I would be
| interested to hear about it.
|
| Generally you have the main community on reddit (memes,
| questions, daily thread for sharing solutions), then the
| language specific subreddits or hosted forums where you will
| see solutions discussed and shared, plus a couple of new users
| asking questions.
|
| Also, within the daily main community thread you will see the
| niche sub community of people posting their code-golfing
| attempts.
| dunham wrote:
| I try to get it done within a day, so they don't back up, but
| I've never tried to compete. I am PST which opens at 9PM. I try
| to get through part 1 then, so I can sleep on part 2.
|
| The subreddit /r/adventofcode contains discussions of solutions
| with lots of different skill levels.
|
| I've done AoC for five years to learn new languages and try
| solve all of them myself during the month of December. (Dunno
| if I'll run the whole thing this year - I have another
| project.) Others try to get on the leaderboard, and some will
| implement solutions that they've seen sketched on reddit.
|
| Last year a few people used Z3 for one of the problems, and I
| went back and tried that to get some experience with Z3. And
| I've occasionally gone back and tried another approach or new
| trick that I saw on the subreddit. (In the years that I've used
| Lean, I've sometimes gone back and added proofs for termination
| or array indices, too.)
| anonzzzies wrote:
| One of the things I look forward to. It is a lot of fun.
| tgv wrote:
| Going to use it to learn a bit of Ada. I've always been curious
| about it. It's not a popular language, and it has some serious
| documentation problems. Sure, there are guides for "hello, world"
| and other basics, but how to use a generic integer vector or even
| how to read lines with two numbers from stdin or a file? That was
| a bit of a puzzle. I saw a solution that allocates an array of
| 99999 elements, just to track the number of occurrences of each
| number in the input.
|
| Ada took me somewhere between 90-120 minutes, whereas I had the
| first problem done in JavaScript in about 30s-60s, just for
| verification.
| Jtsummers wrote:
| _Ada.Integer_Text_IO_ with _Get_ will happily read across all
| whitespace, including new lines, to find the next integer. This
| is true for most (all?) instances of _Get_ , though that may
| not always be what you want. with
| Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
| procedure main is Left : Integer; Right :
| Integer; begin Get(Left); Get(Right);
| Put(Left); Put(Right); end main;
|
| If you give it any of these pairs it'll work as expected, put
| it in a loop and you'll get all of them: 1 2
| 3 4 5 6
|
| Sometimes thinking about lines is a red herring in AoC, the
| lines often don't matter, only getting each value into the
| appropriate collection (a pair of vectors in this case since
| you don't know the size). For the counts, you can use a hashed
| map, they're built into the standard library. If you learn to
| use them now that'll help you out in later days, they're a
| commonly used collection (for me) in these challenges.
| tgv wrote:
| I know that now, even though some of the details remain fuzzy
| (Get_Line reads 100 characters?), but it's just that the
| documentation is a big pile of facts with very little to
| guide you towards the right function/type. And then to get it
| to use in the rest of the code. And of course, many 'modern'
| helpers are simply not available, so that too takes a bit of
| time to find out. But that's learning.
| Jtsummers wrote:
| It stops at 100 or the length of the supplied string or the
| end of the line, whichever is shorter. You can also use
| unbounded strings which allows you to skip specifying the
| size for the output. with
| Ada.Strings.Unbounded.Text_IO; use
| Ada.Strings.Unbounded.Text_IO; with
| Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
| procedure main is Line: Unbounded_String;
| begin Line := Get_Line; Put_Line(Line);
| end main;
|
| https://learn.adacore.com - good source of tutorials,
| unfortunately a lot of the better learning materials beyond
| this are books, not online tutorials.
| wizrrd wrote:
| Yup. Advent of Code is a fun, yearly alternative to LeetCode with
| a Christmas theme, and it's approachable for novice developers.
| devit wrote:
| The first day problem is trivial and also solved in a single
| attempt by o1-preview.
|
| It would be nice if they actually proposed interesting problems
| and of course checked that LLMs can't solve them.
| awkwardpotato wrote:
| This is already answered right on the about page[0]. AoC is
| meant to be an educational experience, feeding it directly into
| a LLM isn't that.
|
| > The leaderboards are for human competitors; if you want to
| compare the speed of your AI solver with others, please do so
| elsewhere. (If you want to use AI to help you solve puzzles, I
| can't really stop you, but I feel like it's harder to get
| better at programming if you ask an AI to do the programming
| for you.)
|
| [0] https://adventofcode.com/2024/about
| criddell wrote:
| Using an AI to solve AoC is like taking an art class and
| complaining that the still life exercises aren't very
| interesting because your camera can capture the image quickly.
| signa11 wrote:
| if you want to use Zig, here are some tips :
| https://kristoff.it/blog/advent-of-code-zig/
| azhenley wrote:
| I'm attempting to make my own language for solving the puzzles as
| I go along.
| lolinder wrote:
| I'd pretty much decided I wasn't going to participate because
| it would take up too much time, but now you've both made it way
| more complicated and way more appealing...
| nemo1618 wrote:
| I did this, and it's been very satisfying! Here's where I'm at
| now: https://www.youtube.com/watch?v=r99-nzGDapg
| bradley13 wrote:
| I never have made it to the end of a season, just due to lack of
| time. It's great fun, though - already solved today's "warm up"
| puzzles...
| tslater2006 wrote:
| I maintain a joke domain which I've found sadly applicable
| through the years. https://adventofrealizingicantread.com. I try
| to keep it updated pointing to the current day throughout the
| month
|
| I've found especially as the month progresses it's just as much
| Advent of Reading Comprehension as it is coding :)
| makapuf wrote:
| It seems it does not work now now?
| ksymph wrote:
| This is the first time I've seen Firefox's alternate stylesheets
| mentioned in the wild. Interesting.
| lyxell wrote:
| I'm using sqlite this year. Hoping that there won't be any
| computational geometry or trie problems. Kind of hoping for a
| graph problem solvable with recursive CTEs, that would be cool.
| ruuda wrote:
| This has been a good driver for me to add features to
| https://rcl-lang.org/. I just added List.sort for today's
| problem.
| SushiHippie wrote:
| Interesting, do you publish your AoC solutions in rcl
| somewhere?
|
| EDIT: nevermind, found it!
| https://github.com/ruuda/adventofcode/tree/master
| fleeno wrote:
| I usually get stuck about halfway through and give up.
|
| Doing it in a Lisp I've been writing in Ruby will have me giving
| up even sooner, but it will be fun!
| gavinhoward wrote:
| This is the first year that I will do AoC. I have never wanted
| to, but I have a working language of my own now.
|
| https://gavinhoward.com/2024/11/advent-of-code-2024-getting-...
| heelix wrote:
| Woohoo! This is my favorite time of the year. As the year rolls
| into vacation'ish days and on call rotations, this is where I
| hunker down and use this to code something other than power
| point. Last year, solved via my primary language (Java), then
| ported to Rust. This year, I'm starting with Rust. I had not
| realized it was the first.
| codr7 wrote:
| I usually do AoC in Common Lisp, but this year I'm giving Swift a
| chance.
|
| It's not half bad at this kind of twiddling for being a
| statically typed mainstream language.
|
| https://github.com/codr7/aoc24/tree/main/swift/Sources/aoc
|
| This year is a tiny bit weird, I was just getting ramped up
| organizing the event at a new job; because I think it's very
| useful for devs to learn some real problem solving, as opposed to
| stitching frameworks.
|
| And then I had to leave because my new boss turned out to be
| someone I couldn't imagine working with.
|
| Guess it'll be just me and Emacs as usual.
| usmannk wrote:
| dont you find all the string parsing and manipulation to be
| quite painful in Swift? I tried to do AoC in Swift before and
| that put me off a lot. I liked doing little functional one
| liners but a week from now the parsing burden will be too high.
| codr7 wrote:
| Nah, the String type is fine as far as basic functionality
| goes, I like adding my own convenience stuff in extensions.
|
| The language has been moving pretty fast though, I have a
| feeling a lot of features I find useful are relatively new.
| tomtom1337 wrote:
| I enjoyed reading your solutions! I'm surprised how terse they
| are!
| codr7 wrote:
| Lovely! I try to strive for readability first and foremost,
| which is a challenge in itself.
| timsneath wrote:
| Excellent! Come and join the Swift leaderboard here
| https://forums.swift.org/t/advent-of-code-2024 if you haven't
| already -- it's super interesting to compare different
| solutions.
| dwayne_dibley wrote:
| Is this any good for beginners/kids?
| michaelfm1211 wrote:
| Sure, but it starts to get hard a few days in so beginners
| won't be able to finish. However, I think that makes it an
| amazing learning opportunity. There's plenty of write-ups on
| solutions on the internet.
| paulb73 wrote:
| I can hear the elves calling me...
|
| But no, last year I lost all momentum on my side projects and my
| gf thought she'd lost me to the elves.
|
| Completing it on time was rewarding but I can't go back.
|
| But I can hear those elven bells a jingling...
| tmtvl wrote:
| I still haven't made my way through all of the 2015 problems yet.
| But I don't play the game correctly any way: instead of trying to
| solve the problems as fast as I can, I try to write well-
| documented easily maintained code which runs fast. Balancing
| 'easily maintained' and 'runs fast' takes a little more time than
| 'just solve it' _and_ I'm planning on working my way through the
| problems chronologically, so I doubt I'll get to the 2024
| problems any time this decade.
| empath75 wrote:
| I try to do everything in a single pure functional expression
| no matter how dumb and unreadable that makes the code look.
| zach_miller wrote:
| That's one of the many ways to do Advent of Code.
| SkiFire13 wrote:
| > But I don't play the game correctly any way: instead of
| trying to solve the problems as fast as I can, ...
|
| FYI trying to solve the problems as fast as you can is not
| considered "the correct way". The author has emphasized
| multiple times that going for the leaderboard is not for
| everyone and requires a pretty questionable coding style. The
| main goal is to have fun and learn something new.
| Dansvidania wrote:
| doesn't the existence of the public leaderboard beg to
| differ? :)
| the_duke wrote:
| This years challenge for me: write it in C without the standard
| library or an allocator. Has to be runnable on an STM32 with 32kb
| of SRAM.
|
| I tried doing it in Assembly two years ago, ended up spending
| hours and hours writing an Assembly standard library, then gave
| up and switched to Rust...
| BoingBoomTschak wrote:
| Good luck! Personally, I'm still going with CL but decided to
| try it in all the languages I "know" for the first day.
| Including C which doesn't have hash tables (inb4 hsearch)...
| what a pain, let me tell you.
|
| https://git.sr.ht/~q3cpma/aoc2024/tree/master/item/01
|
| If you could post a repo link so I can look at some of the
| progress, I'd be grateful.
| nickstinemates wrote:
| I just want to note that Quake 3 CPMA is one of the best
| games ever made. No idea if the handle is in reference to
| that, but thanks for the :)
| schubart wrote:
| Perhaps it's a reference to the Kraftwerk song?
|
| https://www.musixmatch.com/lyrics/Kraftwerk/Boing-Boom-
| Tscha...
| shawn_w wrote:
| POSIX `hsearch` is absolutely terrible and almost useless,
| but... it would get the job done for this problem.
| BoingBoomTschak wrote:
| The advantages of foregoing hsearch is that I don't have to
| understand its weird API that works only for NUL-terminated
| string keys and that I don't require POSIX.
|
| Remember that brute force is also a solution in the AoC;
| had plenty of fun using SBCL to crack some problems where
| Pythonistas had to be clever, last year =)
| Twirrim wrote:
| I don't think there are enough entries to make it worth the
| cost of a hash. I know it's not "efficient" exactly, but just
| repeatedly looping through and counting just isn't that slow.
| 9029 wrote:
| The numbers are so small that you can also just use a big
| array
| sebtron wrote:
| Your restrictions sound quite challenging, good luck!
|
| Last year I solved all the problems in C without _external_
| libraries [1] and I enjoyed it a lot. It forced me implement
| some low-level stuff that I had forgotten how to do (e.g. a
| heap) and to write some numerical routines myself (easier than
| you 'd think!).
|
| [1] https://github.com/sebastianotronto/aoc/tree/master/2023
| derethanhausen wrote:
| Fitting, given that iirc one of the problems was to implement
| a hashtable!
| badgersnake wrote:
| Last year I tried C on a real Amiga 1200 (using DICE, Matt
| Dillon's compiler / runtime). I didn't get very far, lack of
| memory protection makes things really hard.
|
| This year the Amiga has an 060 upgrade with an MMU, so perhaps
| I can figure out how to use that and have another go.
| peterashford wrote:
| Heh. Yeah, a memfault tanking the machine is not conducive to
| iterative programming :o)
| simmonmt wrote:
| Forgive the dumb question... it's been ages since I've done
| Amiga programming in C. What behaves differently? Is the
| lower K of memory mapped, such that null pointer deferences
| cause excitement rather than simply crashing your program? Or
| is it something else?
| 127 wrote:
| Do you have a public repo?
| ikiris wrote:
| this is like trying to solve it in a computer built in turing
| complete
| mlsu wrote:
| Glorious!
|
| I think I'll follow in your footsteps. STM32F7 with 320k but
| with bare metal Rust :)
| nine_k wrote:
| Symmetrically, I would consider only using sh and standard non-
| Turing-complete CLI tools (grep yes, awk no). About as
| limiting, but without devastating memory corruption bugs.
| sudobash1 wrote:
| Awk is turing complete. You could do the challenges only in
| Awk if you wanted.
| nine_k wrote:
| That would be too easy! :)
|
| Well, awk suffices to write a first-person shooter:
| https://news.ycombinator.com/item?id=34442528
| a_humean wrote:
| I think there might end up being some problems which will be
| very challenging to solve with those resource constraints -
| namely memory. You will probably have to be pretty clever with
| your solutions.
|
| I remember one of my naive brute force solutions from last year
| ended up allocating gigabtyes of memory. There were obviously
| more efficient solutions, but some of the inputs are pretty
| large and so hefty allocations might be difficult to avoid.
| foota wrote:
| As long as you can make an RPC call, anything is doable within
| 32kb of ram :-)
| hshshshshsh wrote:
| Work on a side project this December instead of doing this.
| Solving advent of code just keeps you in your comfort zone.
| Creates a false sense of accomplishment. Redirect all the
| positive energy to something that will make you proud when you
| are old or help with an earlier retirement. This won't.
| kissiel wrote:
| Or use it to practice a language that you just wanted to give a
| spin.
| mattbaker wrote:
| Advent of Code is fun, I like having fun! I have no shortage of
| challenges and things to be proud of, but when I'm old I don't
| want to look back and realize I didn't take the time to find
| little moments of joy along the way.
|
| Everyone's different, and it sounds like AoC isn't for you, but
| remember not everyone is you :)
| hshshshshsh wrote:
| That's fair. Just sending the message out to folks who are in
| similiar space and might do a reconsideration.
| moomin wrote:
| I used it to spend time in Haskell. You won't win any prizes
| for speed, but it's a good way to learn a bunch of new stuff.
| yoyohello13 wrote:
| Learn to let go of the constant need to be productive.
| grayhatter wrote:
| > Redirect all the positive energy to something that will make
| you proud when you are old or help with an earlier retirement.
| This won't.
|
| So if some activity [work] doesn't contribute to your ability
| to never have to work again [retirement], you shouldn't do it?
|
| What if I've retired, am I allowed to do AOC then? Or then does
| the first rule of, only do something the future you would be
| proud of apply?
|
| What if all of the things I'm proud of are just a false sense
| of accomplishments? How do I know when I'm actually allowed to
| be proud of it, or if it's just a false sense of pride?
| hombre_fatal wrote:
| Yet you're on HN instead of working on your sideproject.
| keybored wrote:
| I'm gonna do a side project because it's more fun and useful to
| me.
| rubyfan wrote:
| I don't code for a living anymore so this looks fun.
| akkad33 wrote:
| What do you do then?
| markus_zhang wrote:
| Does anyone know what is the theme of this year? If it's VM or
| anything low level then it's fun.
| MortyWaves wrote:
| It's only ever elves finding and losing things
| HeavyStorm wrote:
| I believe that this page should be mobile friendly. I won't be
| coding on mobile, but reading about it on my portable device
| would be great.
| dchuk wrote:
| At least on iOS, Reader mode in safari fixes it right up
| benmccann wrote:
| Svelte is doing its own Advent of Code challenge with a twist
| this year. Instead of challenging users, the maintainers will be
| challenging themselves to launch one feature a day. Today's
| feature is error boundaries!
|
| https://bsky.app/profile/svelte.dev/post/3lcavobxn7c2k
| ranger_danger wrote:
| I read the entire page and I don't see anywhere that it actually
| lists what the puzzles are, I'm so confused.
| auselen wrote:
| - https://adventofcode.com/2024/day/1
|
| - https://adventofcode.com/
| barkingcat wrote:
| I use it to learn new languages - this year it's Ada -
|
| https://blog.adacore.com/announcing-advent-of-ada-2024-codin...
| wodenokoto wrote:
| People here are doing it in Common Lisp and C standard library,
| meanwhile I'm just sitting here trying to get a curl call to
| download the data file.
| eddsolves wrote:
| I just copy and paste into a local text file, but I bet there's
| a tool if you want to do it programmatically already (unless
| curl'ing is your idea of fun!)
| yoyohello13 wrote:
| Copy your session token into .token then:
|
| curl "https://adventofcode.com/2024/day/$DAY/input" --header
| "Cookie: $(cat .token)" > input.txt
| sva_ wrote:
| You could open the dev console in the browser and copy the curl
| command off the network tab
| hoistbypetard wrote:
| The command line tool included with this python library does
| just what you want once you paste your session token into an
| environment variable:
|
| https://github.com/wimglenn/advent-of-code-data
| ljouhet wrote:
| You can use Firefox: "Copy as cUrl"
| (https://superuser.com/a/1382425)
| Symbiote wrote:
| Assuming you already opened it in a web browser, why not right
| click the page and choose "Save As"?
| tocariimaa wrote:
| I have this script: #!/bin/sh set -e
| curl "https://adventofcode.com/${YEAR:?}/day/${DAY:?}/input"
| --cookie "session=$(cat .token)"
|
| then: YEAR=2024 DAY=1 ./aocdata
| cjauvin wrote:
| Because we can assume that these problems necessarily cannot be
| in the training set of any current LLM (and are hard enough, i.e.
| they should be more than mere variations on existing problems),
| I'm wondering if they can be a good benchmark to get a better
| sense of how good they really are at problem solving?
| bufferoverflow wrote:
| Modern LLMs are very good at solving programming puzzles like
| that. As soon as it recognizes which algorithm needs to apply,
| it's just massaging the data to the right format.
| cjauvin wrote:
| Your answer somehow suggests that solving such problems is
| merely "recognizing which algorithms to apply".. which is
| another way of saying that they are more "pattern matchers"
| than "true reasoners". I would think, on the contrary, that
| these problems (at least the tougher ones that are coming in
| about two weeks) require more than pattern matching, but I'm
| not sure exactly what are my thoughts on that.
| throwaway314155 wrote:
| Consider ignoring the reasoning for how/why LLM's can do
| this sort of thing which doesn't matter as much when you
| simply try it out. I wouldn't be surprised if many of these
| problems are in fact solved by LLM's. Just from my
| experience using them to solve relatively novel issues in
| my day-to-day. There will of course be mistakes and
| hallucinations, but in a proper dialogue with a motivated
| programmer, I bet it works >50% of the time.
| matejn wrote:
| I completed last year's in Scryer Prolog and it was a joy. Some
| problems were almost impossible due to the lack of mutation
| (Karger's algorithm comes to mind), but file parsing was a breeze
| and I find Prolog programs generally beautiful. My favourite
| syntactical feature is the full stop at the end of clauses.
| prophesi wrote:
| For anyone interested in using this to learn Elixir or improve
| your skills with it, I saw this video[0] a while back and their
| AoC starter repo[1] is super slick.
|
| [0] https://www.youtube.com/watch?v=gpaV4bgEG-g
|
| [1] https://github.com/ChristianAlexander/advent-generator
| msmitha wrote:
| There are a few Elixir solutions fo Day 1 here, including mine:
| https://elixirforum.com/t/advent-of-code-2024-day-1/67786. I'm
| using it as a motivator for actually learning the
| language/libs.
| prophesi wrote:
| Awesome, in that thread I found this library[0] to make it
| easy to write AoC solutions with Elixir's Livebook.
|
| [0] https://hexdocs.pm/kino_aoc/KinoAOC.html
| ucefkh wrote:
| Getting the vibe of Google code jam
|
| Pretty good tbh
| ucefkh wrote:
| Getting the vibe of Google code jam, pretty good
| kazinator wrote:
| I did some of it in TXR Lisp a bunch of years ago.
|
| https://www.kylheku.com/cgit/advent/tree/2021
|
| Give it a try. The structure and recurring themes in these
| solutions could be used as a source of ideas for how to get
| started.
| mvdtnz wrote:
| I haven't completed one before and I have a question for those
| who have. Can I treat the entire month as one code based which
| evolves over time, with an evolving set of unit and integration
| tests? Or do some days require starting from scratch? Lots of
| people here are talking about completing it in exotic languages
| but I'm more interested in using it to sharpen enterprise coding
| techniques.
| Jtsummers wrote:
| Every day is mostly independent of the others. I generally
| don't reuse code because most of the common code is easy enough
| to rewrite, sometimes I copy/paste earlier code in to a new
| solution.
|
| The main exception is 2019's Intcode VM/interpreter which was
| used over about a dozen days (I mentioned it elsewhere, he
| hasn't done anything like that since). Occasionally, beyond
| basic algorithms there is some continuity between 2-3 days but
| that's not terribly common, I don't think there were any pairs
| of puzzles like that last year or the year before.
|
| If you want to make one code base, you'll still have 25 or so
| separate solutions. You might have some continuity with common
| algorithms (like A*) that get used a fair bit in search
| problems or abstracting out the input handling when you
| identify common structures for parsing.
| cyberpunk wrote:
| I decided to do it in Erlang in 2019, that Intcode VM was
| much "fun"... I really enjoyed it, I wish there were more
| years than that.
| seba_dos1 wrote:
| AoC is in this weird place where it's too easy to be fulfilling
| on its own, but too bothersome to just do it for leisure. I did
| it once (using Python with no imports for some mild challenge),
| waking up super early to actually start on time, then golfing my
| answers if I felt like it. It was a fun thing to do... once. I
| don't feel the need to repeat that and I don't find it engaging
| enough to do without time pressure, so I don't.
|
| Perhaps if you aimed at global leaderboards it would be
| different, but that's neither my league nor I see any fun in that
| - getting there requires serious effort and preparation in things
| that aren't directly related to solving intelectual puzzles.
| 110jawefopiwa wrote:
| It's best for me when I do something that I ordinarily don't do
| for AoC.
|
| I find no particular pleasure in using an everyday language
| like Python for it, because as you said it's too easy.
|
| I have used Haskell, Racket, and in some easier cases APL and
| it's been fun. Treating it more like a puzzle than an actual
| programming assignment.
|
| When learning new languages, it's best to do something that
| actually makes you think in a different shape. If you know
| Python, don't do Ruby. If you know Java, don't do C#.
| seba_dos1 wrote:
| It goes into "too bothersome" territory in this case for me.
| Competing in a local leaderboard was fun and kept me engaged
| until the end, but it was only possible by choosing a
| comfortable language to be free to actually think about the
| puzzle itself to solve it fast. Choosing something that I'm
| not already familiar with (or that isn't well-suited for this
| type of tasks) is a great way to ramp up the difficulty and
| perhaps gain some bragging rights, but I can't see me doing
| it for longer than a few days before losing interest. Even in
| this "easy mode" in Python, there were four days that had me
| spend more than an hour (up to 5h) on the task. There's
| plenty of actually useful projects I could do in this time to
| learn new things instead after all.
| neonsunset wrote:
| C# allows for terser and very functional-y implementations
| thanks to differences between LINQ and Java's Streams.
| dchuk wrote:
| While I agree that just dumping the puzzle instructions into an
| llm and getting the right answer at least doesn't align with the
| spirit of Advent of Code (though it does show how crazy good LLMs
| are getting), I'm using this as an opportunity to try out the new
| Windsurf AI IDE and am driving the AI code editing in it to help
| me write the code to solve each puzzle (I'm using Ruby).
|
| My goal is to develop the muscle memory for the tool so I can
| write code quickly. I'm still generally thinking through the
| puzzles, but being able to just write out plain English logic,
| get code generated, ask for it to be well documented, quickly
| refactor things to be generally reusable, etc, is just fantastic
| and how all software development should be done in this day and
| age frankly. Such an accelerator to problem solving.
| audiodude wrote:
| I know a lot of people use AoC to try out/learn a new language. I
| tried that with Go in like 2018. However, I found it too
| frustrating (especially since AoC requires a lot of string
| parsing/regex which are difficult/verbose in Go).
|
| The past few years I've decided to stick to the same principle
| I've used in all of my side projects recently. Either I do
| something in a new language, or I get it done correctly before I
| get bored. I've found I can't have both.
| thepaulmcbride wrote:
| I usually get to around day 10 in AoC before they get so time
| consuming that I give up. I still really enjoy the first week or
| so though!
| zanderwohl wrote:
| I think I'm going to be using MicroSoft QuickBasic for System 7
| this year. I might regret this pretty quickly.
| struanr wrote:
| Excited to try this. I was aiming to be done by Christmas, but
| this is my first AoC and reading other replies makes this seem a
| bit unrealistic. Decided to do it in elisp to try and improve my
| emacs-fu and lisp knowledge.
| lowbloodsugar wrote:
| New factorio dropped. Probably be doing that with every spare
| minute of the day.
| cod1r wrote:
| This year I'm going to try to do this in Haskell.
| middayc wrote:
| I love looking at AoC solution megathreads on reddit. So many
| languages and so many different approaches are hard to find and
| observe anywhere.
| bargainbin wrote:
| Ah here it is again, 25 days of writing increasingly complex
| input parsers.
| Jcampuzano2 wrote:
| Those are the problems I loathe the most, where the real
| problem is figuring out how to parse the input into something
| more workable. Once its parsed its ezpz.
| underdeserver wrote:
| Claude will do it for you.
| timeon wrote:
| Why bother.
| reocha wrote:
| What is the point in doing a programming challenge if you
| aren't learning anything
| ghjfrdghibt wrote:
| Depends if you're really stuck on a problem. I'd rather
| learn by getting a look at how it's done, even if the code
| is incorrect, than be completely suck with no idea why or
| what to do.
| reocha wrote:
| It's input parsing with a fun story
| b5n wrote:
| I've generally chosen a new (to me) or spartan lang to challenge
| myself, but this year I'm going easy mode with python and just
| focusing on meeting the requirement.
| guiambros wrote:
| Here's to another year of being sleep deprived for the entire
| month of December.
| int0x29 wrote:
| Solved the whole thing. It's a business problem. Just replace the
| Chief Historian.
| declan_roberts wrote:
| AoC is fun for learning a new language but I feel like all of us
| have that one "project" that we rewrite every few years in this
| language or that to learn it.
| izietto wrote:
| What I hate about AoC is the tons of bullshit about Christmas
| elves I have to tolerate before getting to the damn point. I
| mean, I understand they want to make the context entertaining,
| but sometimes it's like reading a Jira card written by a junior
| product owner!
|
| BTW I love AoC for all else
| jlengrand wrote:
| Remarkable. Bought, sold within 2 weeks. Really underwhelmed
| Jtsummers wrote:
| Meant for another discussion?
| jlengrand wrote:
| indeed xD. TY!
| zaptheimpaler wrote:
| I love AoC! Did it the last 2-3 years in Rust, hanging out in a
| discord where we all try to make the absolute fastest solutions.
| Learnt all kinds of crazy performance hacks and some advanced
| algorithms & SIMD that way.
|
| This time I'm trying to do them in Rust and Golang in an effort
| to either learn to like/tolerate Golang (because we use it at
| work) or prove my hypothesis that it sucks and never use it
| unless I have to.
| makapuf wrote:
| Interested by your rust speed approaches, care to share a link
| ?
___________________________________________________________________
(page generated 2024-12-01 23:00 UTC)