That's right! It's time again for the Advent of Code.
Advent of Code wrote:Advent of Code is a series of small programming puzzles for a variety of skill levels. They are self-contained and are just as appropriate for an expert who wants to stay sharp as they are for a beginner who is just learning to code. Each puzzle calls upon different skills and has two parts that build on a theme.
Who's planning on having a go at it this year? Would you be interested in joining a CodeRanch Leaderboard? Just for the giggles of course.
It all starts on Friday 1st December, obviously. Have fun!
I thought I was pretty quick, started one hour after problem 1 was published and finished 20 minutes later, but I ended up part 1 as 1142 and part 2 as 1088.
So if you want to end up in the top, do like Lucky Luke: shoot faster than your shadow.
no these were indeed my rankings at the AOC leaderboard! (I see that these numbers resemble my answers to parts 1 and 2, but they are certainly not equal).
I did read your writing about a CodeRanch Leaderboard, but I did not understand the what or how of this. How would this work?
Is it also an idea to send in our code to some shared GitHub-account, at least one day after a puzzle is published? Or even after the whole event is finished? Always curious how other people solved it, and why they solved it the way they did.
A cow for pointing it out!
Will give a try with Lisp family language probably tomorrow.
I publish my programs on my GitHub account here -> https://github.com/trcooke/adventofcode-2017. I too am always curious to see how others solved things so if you want to share your solutions too, then that'd be brill.
I have some cheap excuse. I've started around 10am local time, which is around 5 hours after publish.
On a more serious side - I wouldn't have expected to beat Piet anyway
Now that I'm on a losing tendence already, will have more motivation to give a go with other language, nothing to lose as you could say
Here is my code: my GitHub
What also I'd expect, well, at least would be interesting, if each subsequent Task would be continuation, I mean - changed requirements, you need to add something extra, so still both features would work - old + newly specified.
That way your previous work wouldn't go to bin, and you'd need to pay attention how you write code, so would be easier to adapt, in which case if you pay attention to details, you could save time in next tasks.
But oh, stop dreaming boy! That's meant to be fun, not sweat.
Tim - I don't know Erlang, but certain parts look similar to Prolog's. In particular taking list apart. Language looks difficult at first glance.
Piet - By looking to your solution I thought you just solved one exercise, but it seems all those very few short lines solve everything. Clever solution, wouldn't come to mind this as a first (if ever) solution probably never. Certainly shorter about 10 times than mine.
But much more important is the fact that we make our codes available, that makes it all worth while. I love to see your erlang solution to part 2.
First and second parts done in Racket: https://github.com/liutaurasvilda/advent-of-code-2017
For those who never tried Racket, it is a beautiful language to explore. For sure, I didn't use its most beautiful features, nor my algorithm is some kind of great, but I tried, and most important - solved. I might will come back and refactor at some point when there will be less stress and nobody will breath to my back
No excuses, Piet is still charging ahead on the leaderboard. Go Piet!
To be honest if the difficulty will grow that speed, most likely I'll get stuck sooner than I'd want to.
Now going outside for a long walk, and in an evening will take a stab at second part. Didn't read second part requirements so I could have a walk without thinking.
Used Racket language again..
Anyway, here is my code at GitHub: https://github.com/PietSnot/AdventOfCode2017/tree/master/src/adventofcode2017
Now I'm on Part 2 - again, not sure if there are some clever tricks, but I'm collecting it like a puzzle by its smallest pieces, feeling that I'm about 30% away from the solution. Don't see any obvious straight forward solution apart from just noticing events and trying to assemble them to some patterns.
Family wasn't happy at all about my weekend's time prioritization. However, hoping to finish this second part either tonight or tomorrow.
If all further going to be like that - probably will have to concede as it takes too much time. I'm sorry.
But maybe it just day 3 like that..
You may have also noticed that I've changed a scoring setting on the leaderboard so that the order is more weighted more on the number of stars you have rather than the speed in which you solved it. Given the participants are spread across the Atlantic I think it makes it fairer. Either way, Piet is still charging ahead
In which case you may want to check leaderboard
I see I'm about to be kicked off the first place. Can't help it much though, during working days I can only solve a puzzle in the evening, at a time when the rest of the world has finished solving long before. Liutauras is right: I think the one with the BEST excuses should win this petit competition...
However, at the end everything went in a less chaotic manner, after I cleaned up code a bit, got all needed parts under control, then just left to wire them up in a nice recursion.
Let's see what Day 5 going to give us... 3:14 am, got less than 4 hours to sleep, but will have them calmed now. Probably coffee cups counter will have to increase tomorrow.