Many of the comments are about the event as a whole, but I'd like to commend the author for the day 1 puzzle, which I think is very cleverly written. Many people (including myself) use these as an opportunity to try out learning a new language, and the first puzzle does a good job of making sure you know enough basic operations for some of the puzzles coming up. The puzzle itself wasn't very difficult, you could do it by hand if you really wanted to, but it required you to know how to read and parse lines in a file, handle compound data structures, iterate through, and perform basic operations (floor, casting strings to ints, etc). I thought it was really well done, and creates the basic knowledge for the puzzles ahead.
> The puzzle itself wasn't very difficult, you could do it by hand if you really wanted to, but it required you to know how to read and parse lines in a file, handle compound data structures, iterate through, and perform basic operations (floor, casting strings to ints, etc).
I don't believe that it required any compound data structures, just looping through the lines in the file.
It's faster to just paste the input into your favorite editor, and massage it gently until it is a literal in the language you're using. No parsing necessary.
lol I actually did this typing into source comma down comma down comma... Only after reading this I realized how lazy I was so went back to do it properly. :)
Self promotion, but as this is my first year doing advent of code I'm solving all of the problems using awk[1], the solutions will be published here[2]
Some problems feel like they were designed to be solved in awk, like the assembly style ones. Others, not so much... But it was great fun overall and I learned a lot about awk.
Eric, the author, says he won't accept any puzzle submissions because of attribution and legal issues. This seems like the wrong outcome for people who want to make the site better but don't want credit, compensation, or attribution.
Has anyone seen a site using an IP assignment agreement which is the equivalent of "take my work, I don't want credit, and it's just for your site"?
The Creative Commons CC0 license comes closest, but one could scrape those puzzles and create a competing site, which I'd guess Eric wants to avoid.
It’s a preference in his case that cannot be solved with licensing. Eric doesn’t want even potential ideas to influence him, and he says he has more puzzle ideas than time to implement them.
Personally, I suspect that he wants something that consumes so much of his free time to wholly be his, and I respect that.
If you want to help, why not ask the people running the site what you can do to help? Do you actually want to help, or do you want to make puzzles? Or do you just want to discuss a perceived problem that may or may not exist?
“your site” is really complicated. Who is “you”, person, website or the company? If it’s the person can they transfer the rights? What happens if they die? If they donate the estate? If they get hired or contracted? If the website expands scope or changes in any way?
Maybe he enjoys/benefits from the work, I feel like coming up with puzzle ideas would be somewhat fun/beneficial. I would definitely assume that if this were not the case he would outsource it or maybe even open source it.
I was doing a little of catching up on older problems to improve my speed to get on the leaderboard and I found that the fastest way to finish one problem was to use oeis.
After seeing the problem [0], I didn't immediately think to use oeis because the manhatten distance of a spiral is pretty easy to code or do by hand. The second stage has a harder sequence though. It prompted me to check oeis and I easily got the answer [2] within a minute of checking.
Looking back at the first stage, I found a sequence for it [1] and PARI/GP code i could run to answer the question. If I had used oeis immediately I would have a solution to both phases in 2 minutes which would be the fastest on the old leaderboard for the problem [3].
I had plenty of 20-20 hindsight about faster ways to have solved puzzles in the past. I don't know if I was ever #1 on any day on either star. I think I might've been top 10, on one star, of one day, once.
This event is a really nice way to try out new programming languages. You can easily find many people doing the challenges in various languages and communities coming together to work through the problems together. It’s also very interesting seeing how each person solves the problem in their favourite language.
Always enjoy doing these but there was one last year that nearly broke me. I think it was day15. It was the worst combination of mind-numbing coding and horribly hard to debug special cases. It was purely convoluted with very little to think about which makes for the worst kind of puzzles
I can totally relate about that particular one, I remember that it destroyed a good part of a weekend for me, and I wrote that about it on Twitter, back in January of this year:
"I have thought about the particular challenges of this year's Advent of Code (which I greatly enjoyed once again, with some intermittent mixed feelings), and my conclusion is that some problems might very well be of similar difficulty levels, but with nevertheless very dissimilar frustration-inducing levels. And I think the frustration level is strongly correlated with the feedback signal one can use to debug. Case in point: Day 15, which was almost impossible to debug, once you had a working solution, versus Day 17, which was actually fun to debug, since the visual signal you could use was so strong."
I strongly disliked the puzzles that quickly devolved to correctly handling a ton of corner cases. 15 and 17 were both in this category.
What's the fun in that? This is like the boring part of being a developer. Without the payment that goes with being a developer.
That one wiped me out for a week too, and caused borderline psychological problems.
Ultimately though I realised that if I followed the description word by word, and made no assumptions, then I got the right solution. Still, a nightmare: you could pass all the examples, or even some alternate real sample data, and still get it wrong if you got the ordering slightly incorrect.
I hit day 15 and stopped last year. There always seems to be one puzzle which is so irritating it no longer seems worthwhile when I could be playing some music or building something in Minecraft or just lazing around on the sofa with the cat.
Day 15 was terrible for me too. The edge condition I missed was that you could both move and attack in a single turn. It only changed the outcome for me in part 2. I was only able to finally debug it by comparing debug outputs every step with a known-good solution.
If someone is interested in the previous years of Advent of Code they are available as notebooks in Peter Norvig's pytudes repository: https://github.com/norvig/pytudes
It looks similar to what I though I had to write, but I will have to reread it and the documentation to understand it well.
And day 2 seems a bit too complex with my meager J knowledge. OTOH with the J interpreter for android and its terseness it seems the most suited language for programming on a phone, so I will probably stick to it.
I completed the whole thing last year; the problems start out very easy, but get dramatically more challenging over the course of the month. Check out the statistics for how many people completed each problem in 2018: https://adventofcode.com/2018/stats
The first few problems are approachable by pretty much anyone who understands how to do arithmetic, file I/O and basic flow control. Many of the later problems require advanced skills such as more sophisticated algorithms (graph theory, dynamic programming, etc.), reverse engineering, and careful debugging.
For what it's worth, I would expect anyone who knows what a loop is to be able to get the first half of today's problem without much difficulty. The second half is a bit less trivial but also pretty easy to understand.
If you're medium fast, they start out in the single digit or tens of minutes range and ramp up to some 60+ minute puzzles the last handful of days (but also some 20 minute puzzles, it varies a lot).
I haven't done it since 2017, and I was pretty quick (made that year's overall leaderboard), but on average they took me about 23 minutes (for both parts).
In general the puzzles involve basic operations that any language would have. Functions, data structures, recursion, some amount of back-and-forth between strings and numbers and records. There isn't any reliance on library-like things like making HTTP requests or parsing complex file formats. I think they would be fine for someone starting out at coding.
Every day's puzzle has two parts. The first part is usually easy. The second part is then a twist that requires a change to the solution of the first part.
Apart from that, you can always skip a day if you just can't solve it. The exception is that sometimes a puzzle can reference the solution of an older day, so if you'd solved the older day you would already have an understanding of how to proceed, and might be able to reuse some code.
First couple of tasks are really easy, but difficulty increases over time and so does time needed to solve them.
Someone who is currently learning about loops might not be able to solve these on their own, but with someone else's help they might learn lots of useful concepts (e.g. linked lists, bfs, basic asm, how to code efficiently...) and try to apply them.
AoC are solving usually those who are quite familiar with programming and want to learn a new language or to compete with colleagues.
I wondered the same, also thinking about people I know who are starting to program.
In the end I think it's not a good fit, given that basic concepts are still being understood, and the mere task of reading a file and iterating over the lines, even the concept itself of what "iterating" is, is already a big challenge...
Trying is free and won't hurt, though, so why not :)
For someone just starting out they would get stuck on this very first problem, it involves recursion. People 'get' recursion, but coding it is something different.
Advent of Code is a lot of fun! Last year I wrote a little bit about all the different languages/approaches people use to solve the challenges: https://j11g.com/2018/12/03/advent-of-code/
I went to bed before trying it last night, but couldn't sleep. So I did the day one problem early this morning. It was fun, and went quicker than I thought. I guess I must've improved from last year.
[+] [-] aquova|6 years ago|reply
[+] [-] klemenk|6 years ago|reply
[+] [-] znpy|6 years ago|reply
I hadn't thought about that! I'll take this as an opportunity to learn Rust!
[+] [-] melling|6 years ago|reply
I’m trying to solve them with Swift Playgrounds on the iPad, for example. And I can’t figure out how to create a simple text file for the data.
[+] [-] zeveb|6 years ago|reply
I don't believe that it required any compound data structures, just looping through the lines in the file.
You're right about the rest, though.
[+] [-] kitd|6 years ago|reply
I have used http://www.https://cryptopals.com/ for a similar purpose, with the added benefit of learning about cryptography as a parallel outcome.
[+] [-] ahaferburg|6 years ago|reply
[+] [-] rb808|6 years ago|reply
[+] [-] messe|6 years ago|reply
[1]: https://man.openbsd.org/awk
[2]: https://jo.ie/advent-of-awk-2019.html
[+] [-] bewuethr|6 years ago|reply
Some problems feel like they were designed to be solved in awk, like the assembly style ones. Others, not so much... But it was great fun overall and I learned a lot about awk.
[+] [-] nabraham|6 years ago|reply
Has anyone seen a site using an IP assignment agreement which is the equivalent of "take my work, I don't want credit, and it's just for your site"?
The Creative Commons CC0 license comes closest, but one could scrape those puzzles and create a competing site, which I'd guess Eric wants to avoid.
[+] [-] tl|6 years ago|reply
Personally, I suspect that he wants something that consumes so much of his free time to wholly be his, and I respect that.
[+] [-] arve0|6 years ago|reply
[+] [-] ahaferburg|6 years ago|reply
[+] [-] inerte|6 years ago|reply
[+] [-] mjtlittle|6 years ago|reply
[+] [-] thethirdone|6 years ago|reply
After seeing the problem [0], I didn't immediately think to use oeis because the manhatten distance of a spiral is pretty easy to code or do by hand. The second stage has a harder sequence though. It prompted me to check oeis and I easily got the answer [2] within a minute of checking.
Looking back at the first stage, I found a sequence for it [1] and PARI/GP code i could run to answer the question. If I had used oeis immediately I would have a solution to both phases in 2 minutes which would be the fastest on the old leaderboard for the problem [3].
[0]:https://adventofcode.com/2017/day/3
[1]:https://oeis.org/A214526
[2]:https://oeis.org/A141481
[3]:https://adventofcode.com/2017/leaderboard/day/3
[+] [-] loeg|6 years ago|reply
[+] [-] forrestthewoods|6 years ago|reply
I strongly recommend using AoC as a tool to help learn a new language. Many people, myself included, use it to learn Rust.
The best part about AoC is the community. Everyone is super helpful and kind. The daily Reddit thread has solutions in every language under the sun.
My better half is a designer and is going to participate this year to help learn JavaScript.
[+] [-] dross|6 years ago|reply
Looking forward to the fun, the stress and the eventual euphoria.
[+] [-] evenh|6 years ago|reply
[+] [-] dom96|6 years ago|reply
For example, here is the Nim communities effort: https://forum.nim-lang.org/t/5588
[+] [-] Barrin92|6 years ago|reply
[+] [-] cjauvin|6 years ago|reply
"I have thought about the particular challenges of this year's Advent of Code (which I greatly enjoyed once again, with some intermittent mixed feelings), and my conclusion is that some problems might very well be of similar difficulty levels, but with nevertheless very dissimilar frustration-inducing levels. And I think the frustration level is strongly correlated with the feedback signal one can use to debug. Case in point: Day 15, which was almost impossible to debug, once you had a working solution, versus Day 17, which was actually fun to debug, since the visual signal you could use was so strong."
[+] [-] m000|6 years ago|reply
[+] [-] AdeptusAquinas|6 years ago|reply
Ultimately though I realised that if I followed the description word by word, and made no assumptions, then I got the right solution. Still, a nightmare: you could pass all the examples, or even some alternate real sample data, and still get it wrong if you got the ordering slightly incorrect.
[+] [-] m1kal|6 years ago|reply
[+] [-] mathw|6 years ago|reply
[+] [-] wycy|6 years ago|reply
[+] [-] sunaden|6 years ago|reply
[+] [-] narimiran|6 years ago|reply
I was aware of Norvig's 2016 AoC solutions, but I thought he never did any of the newer editions. I know what I'll be reading today :)
[+] [-] qznc|6 years ago|reply
[+] [-] JaumeGreen|6 years ago|reply
It looks similar to what I though I had to write, but I will have to reread it and the documentation to understand it well.
And day 2 seems a bit too complex with my meager J knowledge. OTOH with the J interpreter for android and its terseness it seems the most suited language for programming on a phone, so I will probably stick to it.
[0] https://www.reddit.com/r/adventofcode/comments/e4axxe/2019_d...
[+] [-] macintux|6 years ago|reply
https://www.reddit.com/r/adventofcode/
[+] [-] sergiotapia|6 years ago|reply
[+] [-] _v7gu|6 years ago|reply
[+] [-] dang|6 years ago|reply
[+] [-] jammygit|6 years ago|reply
Also, I know somebody who is just starting out at coding. Would it be too hard for them? They are brand new, learning about loops
[+] [-] teraflop|6 years ago|reply
The first few problems are approachable by pretty much anyone who understands how to do arithmetic, file I/O and basic flow control. Many of the later problems require advanced skills such as more sophisticated algorithms (graph theory, dynamic programming, etc.), reverse engineering, and careful debugging.
For what it's worth, I would expect anyone who knows what a loop is to be able to get the first half of today's problem without much difficulty. The second half is a bit less trivial but also pretty easy to understand.
[+] [-] loeg|6 years ago|reply
I haven't done it since 2017, and I was pretty quick (made that year's overall leaderboard), but on average they took me about 23 minutes (for both parts).
[+] [-] Arnavion|6 years ago|reply
Every day's puzzle has two parts. The first part is usually easy. The second part is then a twist that requires a change to the solution of the first part.
Apart from that, you can always skip a day if you just can't solve it. The exception is that sometimes a puzzle can reference the solution of an older day, so if you'd solved the older day you would already have an understanding of how to proceed, and might be able to reuse some code.
[+] [-] IbyvzOneoneh|6 years ago|reply
First couple of tasks are really easy, but difficulty increases over time and so does time needed to solve them.
Someone who is currently learning about loops might not be able to solve these on their own, but with someone else's help they might learn lots of useful concepts (e.g. linked lists, bfs, basic asm, how to code efficiently...) and try to apply them.
AoC are solving usually those who are quite familiar with programming and want to learn a new language or to compete with colleagues.
[+] [-] j1elo|6 years ago|reply
In the end I think it's not a good fit, given that basic concepts are still being understood, and the mere task of reading a file and iterating over the lines, even the concept itself of what "iterating" is, is already a big challenge...
Trying is free and won't hurt, though, so why not :)
[+] [-] sergiotapia|6 years ago|reply
[+] [-] donatj|6 years ago|reply
[+] [-] Kinrany|6 years ago|reply
[+] [-] janvdberg|6 years ago|reply
[+] [-] sircastor|6 years ago|reply
[+] [-] LandR|6 years ago|reply
I can't tell from the description what the actual puzzle is...
Is it that I need to generate a program that generates the output 19690720 when run through the function that was written in part 1?
[+] [-] andonisus|6 years ago|reply