Advent of Code 2019
adventofcode.com
adventofcode.com
I was one of the 271 people who had all 200 stars (i.e. completed all puzzles) when Eric tweeted out that stat.
Usually takes anything from 5 minutes to an hour do most puzzles, quickly hacked together in perl. Very occasionally there's one that takes longer than that. Sometimes I redo them in different languages (Go to try that out, C to remind me how bare bones the base language is, etc).
Can't wait for it to start this year.
Very much looking forward to this year's edition and am on several leaderboards.
I warmly recommend this presentation Eric gave in a conference in Sweden a little while back:
AoC got to be a bit of a grind for me last year. Something came up, and I missed a few days towards the end. I told myself I was going to go back and finish, but I never did.
I'm tempted to try again this year, but I don't know. I already have projects languishing in need of some attention. On the other hand, it's lots of fun.
Related is the tool of choice. I was and would probably still be using Python with the addition of Numpy which by studying other solutions found out to be quite efficient for the AoC type of combinatorics puzzles. Although I had the intention of learning it I didn't make it over the course of a year.
Hopefully this year I can make it past day 14. It's strange, but I got stuck or tired on day 15 both years. We'll see how it goes, I'm planning on learning Clojure this year with AoC. I've only started learning the language a bit these past 2 weeks, but I'm sure I'll have fun with it.
To all participants this year: remember to have fun!
Different people get slightly different problems, so you have to do your own work to solve for your puzzle input. You feed it back into the site to see if it was correct or not. Getting a problem right was a great feeling, and it progressively unlocks more of a Christmas-themed ASCII art picture.
I would have a tough time explaining it to someone who doesn't do any programming, but it's free to try if you're curious!
But apart from that it is “just” coding challenges with a story wrapped around them, and if you don’t like those, you won’t care for it.
and see on the sidebar on the right in desktop view, the "Solution Megathreads" e.g. from Day 5 last year there is https://www.reddit.com/r/adventofcode/comments/a3912m/2018_d... with tons of solutions including more oddball ones like VimScript, less popular like Common Lisp and APL, and lots of people use it as an excuse to learn/use a new language, so plenty of Python, Kotlin, Rust, C#, GoLang, D, and so on.
As the days go on, the challenge difficulty increases quite a lot (not linearly) so the threads often turn to discussions about performance, mini-competitions between people, tips on complexity, different approaches and debugging, etc.
This guy finished in the top 10 last year and streamed(not live) his solutions so you can see how fast you need to be to be competitive: https://www.youtube.com/watch?v=Hgv6d6rrQxo&list=PLZhotmgEsC...
Each day's puzzle is not one, but two-fold. You first solve the problem you're given, and then the second half is unlocked. /This second half usually incorporates some sort of twist./ That means that you may have to rethink your program, generalize it, find some missing optimization or think your way around the problem as it's given, etc.
In some ways, it feels like what you have to do to a real program: You write what you think is a perfect solution, then discover you need to model the problem more deeply, or refactor it all, or scrap it and start over. It's a flavor of 'puzzle realism' that makes each day a bite-size nugget of a challenge that's genuinely fun to work out.
e.g. once in 2017 you had problem1: implement an interpreter for this asm-like language. ok, 5 instructions, super easy. ...problem2, run this asm-like program. You couldn't, it was 10^n iterations, would take days. You had to read, understand and optimize the asm-like code.
last year I was amazed writing a function to check if two rectangles intersect (you can do it in like 2 lines)
so, TLDR, you get a lot of "hey that's cool! I never thought about it"
Edit: The aspect of customized tasks does not require sign-ups. Just use a cookie or something.
The number of things you need a membership for a extremely limited. Can you imagine if you went to your local supermarket to buy milk, and they said "I'm sorry, you can't buy milk without a membership".
Surely this is one of those cases when a signup is not necessary. Anyone who asks for personal data they do not genuinely require should not be trusted.
We're almost there. At Safeway, you can buy without a membership, but it costs up to twice as much.
Someone downloads their input, clears their cookies before submitting solution & then their solution is "wrong" because they're using an outdated input.
Seems like tying you to something more persistent i.e. a google/twitter/reddit/github acocunt is a more reliable strategy
This one has a fair bit: https://gitlab.com/BafDyce/adventofcode
Verifying your answer will be tricky though, since you won't know if someone else's code is correct for your input unless you find a repo that also includes the verified result.
For instance, coming from mostly TS/C# I'm not going to be productive in Rust over night.
24 exercises sounds about right to me.
Good luck and have fun with it!
I'm not competing, partly because I don't want to be up at 6AM, and partly because I like it better as a relaxed 15-30 minutes where I learn some new stuff about the environment I'm working with (for example, one year I used CMake to build, just to get some experience with it).
Maybe I'm misunderstanding something, but this doesn't seem very exceptional. To me this seems to be 100% within the spirit of the project.
I didn't even know there were competitive aspects in place.
> Getting a star first is worth 100 points, second is 99, and so on down to 1 point at 100th place.
I absolutely love and share your approach. Learn new stuff and grow.
This reminds me of SpaceChem, Magnum Opus, or other games like that. I get a solution and then I optimize the solution and explore other methods of getting there.
Let's see what excuse I have this year!
As I recall, most of the time the input is delineated by spaces or linebreaks and it helps if you can carve it up easily right off the bat.
By limiting yourself to the standard library at first, I find that you can get a good feel for the language itself.
You could look up some of the published solutions from last year to get a feel for what is possible.
Example: https://github.com/bertptrs/adventofcode/tree/master/2018/sr...
This person kept a minimal common library for recurring functionality and a small wrapper application that launches the code for each puzzle. It looks like a really clean approach.
Also had a good learning experience using the nom parser combinator package [0], but this takes a bit of code (that you can often reuse between days).
If you are aiming for fast solutions, the !scan macro of serde-scan [1] is made for exactly this, but then you are far outside the core language...
[0]: https://crates.io/crates/nom [1]: https://docs.rs/serde_scan/0.3.2/serde_scan/macro.scan.html
Last year I asked the same, and I found this answer on SO:
https://stackoverflow.com/questions/31046763/does-rust-have-...
See the answer which mentions the "text_io" crete.
i.e. pass the input from standard input, and just build an on-the-go Vector of some data type that is appropriate for the problem at hand. Day 3 was different from 1 and 2 in that for the first time the parsing was not immediate; using Serde and Recap modules did a fantastically succinct job of parsing the text input. Of course it depends on how much you want to rely on external crates.
Let's see if this year I can do more than 3 days worth of AoC :-)
For me, this year, I'll give it another try to get into rust a bit more. Or maybe finally golang, after all these years of enterprisey java.
For the simulation-style challenges, I've found the language to be an absolute pleasure, giving some truly lovely code; I'm fairly sure you could make similarly lovely OO code as well, but my tastes find the functional expression of the simulation extremely attractive. Some debugging certainly does get easier, in my opinion.
This year though, I'm not even starting until January! I find I get completely obsessed with trying to complete them and it can ruin December for (the people around) me ;)
Looking forward to January 1st though :D
If you want to stay competitive, you've got to invest some time right before Christmas, so I gave up on that pretty quickly. Instead I did the puzzles at my on pace and spent some extra time playing with the puzzles that I found especially fun:
https://twitter.com/StefanChrobot/status/1080574491535781899
https://twitter.com/StefanChrobot/status/1078448111041892352
As a bonus, you get something to show whenever you're asked to share some code when applying for a job!
And then there's the learning factor - the puzzles are progressively more difficult, but I guess still doable for the average programmer. At some point some of them start to feel repetitive, but that's great if you get a good hold on processing data in your language of choice.
My “toolkit” is Perl and an Emacs expansion that adds some boilerplate reading text files and stuffing them into a list.
Edit here's what's expanded when I type "aocinit" an empty buffer:
https://gist.github.com/gustafe/27be34b3c57728f40101a93a95ce...
Since it's your first year, none of that's needed - just enjoy the puzzles, and search for any useful patterns or tools as you go along. Eric's recommendation is to make the puzzles work for whatever goal you're aiming for - speed isn't necessarily one he recommends, instead recommending it as a tool to learn new languages, or to try new skills, such as visualization.
You don't have to race, it isn't required, but the people who do race are very very quick off the draw - they have scripts which login and download their data file as soon as it's available, then templated code ready to read it in as if it were numbers, as if it were a CSV, and load up some counter variables and arrays to save a few seconds typing, and they skim read ignoring the story, trying to jump to the calculation, code it in moments, run it, get an answer, paste into the site, and verify it. Then download the datafile for part two, skim read the story for part two, modify their code to handle it, run it, get an answer paste that in. First person did both those, all that, in 1 min 48 sec. (!)
Toolkit is mostly "I've done this last year, know what held me up, or what patterns came up several times", you don't need one at all if you're not racing for the first 100 answers.
btw. you can sign up now and do previous year's puzzles if you want to see what it's like.
i love the idea, i love having a streak to keep you going, but i have a lot of things i want done before i sharpen the saw again - i need wood cut first :-)