Live data from Hacker News

Advent of Code 2017

adventofcode.com

61–70 of 77 posts

Re: Advent of Code 2017

#61
post #3

AoC is lots of fun. There's an active community on http://reddit.com/r/adventofcode where people share tips and help each other out. I highly recommend participating. AoC is designed as a speed coding competition, but if you aren't playing for the speed points, it's a fun way to learn a new programming language.

It's really not designed as a speed coding competition; that's just what it became by accident. Eric built the first edition for friends and friends of friends, expecting maybe 70 people to participate. He thought a 100 person leaderboard would be more than enough. The look on his face the next day when he realized what had happened and that his infrastructure wasn't going to hold up was priceless :)

That said, it is a fun way to learn a new programming language or to brush up on one you haven't used in a while. Stop by the subreddit and get help if you're having trouble or give some help if you're able!

Re: Advent of Code 2017

#62

The about page doesn't say: is there a specific language used for these?

There isn't, by design. You write _some_ black-box implementation locally which outputs a textual solution you drop into the browser (at least, this is how it was in 2015 when AoC started). I can't recommend this enough. I had to miss out on last year's challenges, but planning on participating this year; it's a great way to keep your brain nimble if you feel like you're in a rut.

The prior events are still available! http://adventofcode.com/2016 and http://adventofcode.com/2015

Re: Advent of Code 2017

#63

I haven't done AoC before. Does anyone know if it's possible to submit 2 solutions? I want to use this to brush up on my Python, and I want to start digging into Rust.

Last year I solved most problems the first time through using Perl and then later came back and used it to try to learn Rust. The second time through I started by writing test cases using the known-good answer from the Perl implementation.

Re: Advent of Code 2017

#64
post #5

While I enjoy advent of code I always have been happy to live on the west coast. I wonder how many people on the east coast don't participate because they'd have to stay up til midnight if they want to score.

It could be fun if each puzzle were unlocked after 23h (or 25h). I.e. the start time shifts everyday by 1h to make it "fair" no matter what timezone you live in.

As a moderator on the subreddit and coworker of Eric Wastl, that'll never happen because we would die. It's set up so that puzzles unlock at a time that Eric is awake and able to respond to any issues that may arise.

Re: Advent of Code 2017

#65

Earlier quoted context omitted.

> This year I need to make sure I do the graph search problems properly I'm guessing this year it might be some other 'common theme' for the tasks, and we might not see as many graph-problems as in 2016. But learning graph searches cannot hurt you either way :)

Are there any good resources you'd recommend on learning how to effectively work with/search graphs?

Robert Sedgewicks Algorithms II on Coursera covers a few graph search techniques

Re: Advent of Code 2017

#66

Earlier quoted context omitted.

> This year I need to make sure I do the graph search problems properly I'm guessing this year it might be some other 'common theme' for the tasks, and we might not see as many graph-problems as in 2016. But learning graph searches cannot hurt you either way :)

Are there any good resources you'd recommend on learning how to effectively work with/search graphs?

https://www.redblobgames.com/ has a great A* intro with visualizations and code. I highly recommend it.

Re: Advent of Code 2017

#67

Earlier quoted context omitted.

Are there any good resources you'd recommend on learning how to effectively work with/search graphs?

https://www.redblobgames.com/ has a great A* intro with visualizations and code. I highly recommend it.

This would be my reply too. The whole site is great! I've recently went through hex grid tutorial - very informative, interactive and nicely presented.

Re: Advent of Code 2017

#68
post #59
post #22

I'm doing it this year. In D, because I'm stubborn, enjoy the language, and couldn't immediately get to like Rust. Going by hype, I have a feeling learning Rust will some day be as inevitable as interacting with git, but for the moment I'm sticking to D.

Out of curiosity, what do you enjoy about D?

It's essentially the C++ I always wanted, which is more or less its intent.

It's fast. The D code I write routinely matches or outperforms the C++ I also write for comparison.

D is a much cleaner language. It has obvious C++ inspirations but has thrown out decades of backwards-compatible cruft.

As a result, D has some of C++'s best features, like sophisticated metaprogramming, with much nicer language. In fact, this is the part I like the most: compile-time function evaluation. D allows you to evaluate essentially any function at compile time for which all of its inputs are known at compile time. It almost feels like lisp macros, with the slight downside that they work on unstructured strings instead of (minimally) structured sexps.

D is safe. It produces stack traces when I mess up instead of segfaults. It won't let me compile the most obvious errors it can catch at compile time. I'm not even sure yet if it's possible to have UB in D.

D is flexible. It doesn't impose an opinion on how I should do things. I can do OOP, functional, or procedural as I please and provides useful tools to do all those. OOP is like the familiar classes you know from C++ and Java with interfaces instead of multiple inheritance. Functional programming utilities are useful without being burdensome. You can totally do a for loop in a pure functional function as long as the overall function has no side effects, which is very practical.

D has a bunch of other niceties which you can explore in the D's gems section here:

https://tour.dlang.org/tour/en/gems/uniform-function-call-sy...

Post reply on HN