Live data from Hacker News

Advent of Code 2019

adventofcode.com

41–50 of 75 posts

Re: Advent of Code 2019

#41
post #36

Found it in 2016 and have done it ever since (and in the early days of December 2016 I went back and did the 2015 puzzles I'd missed). 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 red…

Maybe Raku would also be a nice language to try things out :-) https://raku.org

Re: Advent of Code 2019

#42

This year I really want to try to use this to learn Rust. Are there any good practices or crates to handle file input like most of the problems give? 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.

I did part of last year in rust and found that indeed iterating over lines and splits worked quite well.

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

Re: Advent of Code 2019

#43

This year I really want to try to use this to learn Rust. Are there any good practices or crates to handle file input like most of the problems give? 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.

I tried AoC in Rust two years ago, and you really don't need anything beyond the excellent standard library. Rust has lots of nice features that make working with the type of input AoC gives trivial. 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. Exa…

I would recommend against a common framework if this is your first venture into rust: I tried exactly this last year, but since I was learning a lot about the language along the way I kept having to go back and update previous days to reflect framework updates.

Re: Advent of Code 2019

#44
post #39

Earlier quoted context omitted.

Last year I did "Advent of Elixir" at my company with the puzzles from AoC. It was slow paced but I got some people excited about Elixir! I also followed José Valim on Twitch to see how he tackled those. 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…

Do the problems require familiarity with say more serious algorithmic techniques such as graphs?

In general - no. Not in order to solve the problem. But participants familiar with such techniques will often recognize a pattern in a given problem and provide an elegant solution.

Re: Advent of Code 2019

#45
I have done it every year, mostly in Rust or C++, with a smattering of other languages (Factor, SML, Haskell). I think I will go with Racket this year.

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).

Re: Advent of Code 2019

#46
As good as AoC is, I think this year I might try and develop the same program (or maybe solve a single one of the puzzles) each day in a different programming language. So one puzzle, 24 languages.. I sorta feel I'd learn more from that rather than sharpening the same knife over and over, perhaps.

Re: Advent of Code 2019

#47

I have done it every year, mostly in Rust or C++, with a smattering of other languages (Factor, SML, Haskell). I think I will go with Racket this year. 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…

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

Re: Advent of Code 2019

#48

As good as AoC is, I think this year I might try and develop the same program (or maybe solve a single one of the puzzles) each day in a different programming language. So one puzzle, 24 languages.. I sorta feel I'd learn more from that rather than sharpening the same knife over and over, perhaps.

Some knives needs more sharpening than others before they get useful.

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.

Re: Advent of Code 2019

#49
I think I am just going to move on one or more of my personal projects forward each day, and tweet about it. just to have a streak ...

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 :-)

Re: Advent of Code 2019

#50

This year I really want to try to use this to learn Rust. Are there any good practices or crates to handle file input like most of the problems give? 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.

> This year I really want to try to use this to learn Rust. Are there any good practices or crates to handle file input like most of the problems give?

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.

Post reply on HN