Live data from Hacker News

Advent of Code 2019

adventofcode.com

51–60 of 124 posts

Re: Advent of Code 2019

#51

These are daily programming puzzles? How long do they take on average? 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

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.

I just knocked out a non-recursive solution in 9 lines of python in five minutes.

Re: Advent of Code 2019

#53
post #49

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] [1]: https://man.openbsd.org/awk [2]: https://jo.ie/advent-of-awk-2019.html

With respect to the fact that 99% of my use of awk is done like this:

  > | awk '{print $}'
The solution to the first exercise looks surprisingly clean. It will be interesting to see how they continue as the challenges get harder. Bookmarked!

Re: Advent of Code 2019

#54

I like everything about this except the name. the word advent is religious.

The name is reminiscent of an advent calendar, which traditionally has a labeled door behind which is a piece of candy, small toy or other trinket. These calendars are intended for young children to remind them of the period of advent.

If you are religious, look upon this as a similar thing which reminds you of the season, building in anticipation of the final day.

If you are not religious, it's just a word with no special meaning other than the time of year. Same goes if you are not of a Christian religion.

Re: Advent of Code 2019

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

For example, here is the Nim communities effort: https://forum.nim-lang.org/t/5588

Re: Advent of Code 2019

#56
post #27
post #14

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 i…

Learning new environments can be painful so it’s good it starts off easy. 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.

I solved the first part using the examples. Swift is nice.

   func calcFuel(_ mass:Int) -> Int {mass / 3 - 2}

   let z0 = massList.map(calcFuel).reduce(0, +)
or simply ...

   let z1 = massList.map({$0 / 3 - 2}).reduce(0, +)
Any idea how to read the data on the iPad?

Re: Advent of Code 2019

#57

I like everything about this except the name. the word advent is religious.

This is only true when it's used as a proper noun; in which case, yes, it refers one of two things in the context of Christianity.

Otherwise, it's just a normal word which means "the arrival of a notable person, thing, or event".

Re: Advent of Code 2019

#60
post #44

Earlier quoted context omitted.

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.

Yeah, it's really frustrating when the text summary is vague and underspecified. It makes it hard to understand exactly the result the author is looking for, which isn't the fun kind of puzzle.

I think the problem was it _felt_ vague and under specified. But when I read it closely enough, it actually was exactly specific.
Post reply on HN