top | item 29404599

(no title)

flaie | 4 years ago

I have been solving these since years, I find it a nice way of assessing a language and deep dive since it will cover lot of parts of what makes a language.

I have been porting my old solutions in other languages into Kotlin over the time, and will be again doing them in Kotlin. I find it a nice language for AOC since custom extensions and DSL possibilities, it has a good builtin libraries and you can always fallback on Java, even if it has some shortcomings.

Regarding the AOC per se, I take it as a fun daily challenge, I know I won't be able to be part of the top 100, at least I would with some luck during the first 3 days, and then.. nope, that's life, try not to be too competitive. Last year it took me 8 hours to solve day 20, but it's a game, you should have fun doing it (I had), if not people should stop.

However, I strive in trying to write pretty, compact, idiomatic and as functional as possible code, which means that sometimes I will write an ugly solution in 5 minutes, and will take an hour to make it beautiful.

Besides I like to read the story, I know plenty of friends who don't even read the adventures of Santa, they just solve the puzzle and that's it, they don't even know they saved Christmas :-D !

discuss

order

Jtsummers|4 years ago

> which means that sometimes I will write an ugly solution in 5 minutes, and will take an hour to make it beautiful.

I think I spent 2 hours last night just playing around with different methods of solving it after my initial version. Other libraries, slightly altered algorithms. I think that's one of the parts I enjoy the most, solving the puzzles is fun. Trying a dozen different variations is, for me, more fun (and more edifying).

matsemann|4 years ago

Yeah, kotlins stdlib for collections is great. Has all kinds of variants of reducing, grouping, filtering, mapping, taking, dropping etc one can think of. Today's solution was to just call the window function.

101011|4 years ago

Spoilers dude! I haven't started yet.

ducharmdev|4 years ago

Haha, your last line really made me smile.

akpa1|4 years ago

2020's day 20 was really tricky - that, and day 23 were the only two days I didn't manage to solve two parts on. I managed to get part one for day 20, but neither parts for day 23. It was good fun trying both, though!

raldenx|4 years ago

I can vouch for wasting hours of coding due to not reading the problem thoroughly.

patrickdavey|4 years ago

Or not trimming your input. I worked and reworked and reworked a problem once, the answer was some number in the billions. Eventually I gave up because I just couldn't work out where I went wrong. I then took someone's working solution and plugged my input in, and I was out by one, because it counted chars and I had a stray newline.

I'd like to say it only happened once, but, it happened again later that year... And then never again (because I pulled out code to always strip newlines after reading it in ;)

tslater2006|4 years ago

This led me one year to registering adventofrealizingicantread.com

It just redirects to the advent site but I've grown to love it :)