Forums Register Login
Advent of Code 2017 - Any interest for a CodeRanch leaderboard?
(0 likes, 4 cows)
It's getting to that time of year again when us nerdy types get to shun the trappings and jollies of the Christmas holiday season and absorb ourselves in pointless, but fun, programming puzzles.

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!
(1 like)
I'd love to, if I could find the time. Well, maybe I still can. Thanks for the heads up though.
A reminder that the fun kicks off tomorrow! Who's in?
I haven't heard of this before. It sounds fun! Ik check it out, but my December is quite packed with appointments, so I don't know how much time I'll have.
Most of the people I know that do this feel just like you Stephan. I never get through them all but really enjoy it all the same.
That's day 1 done. I see Liutauras has finished also.

I wrote my program in Erlang. What language did you use?
I hardly dare to confess in these days of FP and kotlin, so please don't spread it around, but I used java.
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.
As I understand it there are many variations of the input data set so the chances are the answers you get will not be the answers I require, and visa-versa.

Would you be interested in joining our Leaderboard Piet? And Stephan and Junilu of course?

Piet Souris wrote:but I ended up part 1 as 1142 and part 2 as 1088

Oh wait, are you referring to your puzzle output? Or your global leaderboard ranking? It's your ranking right?
hi Tim,

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!
I did in Java, poor choice, could have picked something more intriguing.
Will give a try with Lisp family language probably tomorrow.
(@Liutauras: grinnik, grinnik)

Yes, while I was thinking about rotating collections and zipping, I ended up with just 3 lines old-fahioned java < 8 code. I'll try puzzle 2 in scala, puzzle 3 in R, see how that goes.
Piet, I've sent you a PM with the code required to join the leaderboard. It's all just for a bit of fun.

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.
Ah ha, Liutauras you've been knocked off the top spot of the leaderboard by Piet. Good work Piet
Damn! Been dragged down by Piet.

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
In that case: Liurauras, I apologize! (not for a single bit)   

Here is my code: my GitHub
But seriously, that is a good chance to play around with some other language you don't work regularly.

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.
Looking to other solutions, I use my right not to show mine most boring solution for Day 1 

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.
Well, rest assured: my solution to exercise 2 is much longer, about 75 lines of code. A little more difficult than yesterday, but still very much doable. In the global leaderboard I was ranked place 2201, and part 2 1124.

Have fun!
You are putting us all to shame. I just can't get up that early.
Well, we have here CET, and I guess you have GMT, one hour difference and that explains it all! And Liutauras has to do some feeding and cleaning first, I bet!   

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.
That's Day 2 Part 1 done, again in Erlang. I'll do the other bit later on.

I solved day's 2 part one. In Lisp family language (as promised), but got to go now and will be back later to solve second part.

Piet Souris wrote:And Liutauras has to do some feeding and cleaning first, I bet!    

That may sound again as an excuse, but I really have to solve them in a high decibels environment
Went to barbershop with my wife, so been outside since 12pm, and oh dear, didn't know for women it takes nearly 3 hours to get things done (haircut + dyed hair) and as if that wouldn't be enough, chelsea footbal match was today, so stuck in a dead traffic - NO NO, I'm not looking for excuses! I was solving 2nd part in my head (and pretty much did it correctly) while was waiting and commuting. Just had to put down the code to racket ide when came back home

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 
Perhaps in 2018 we'll run an Advent of Excuses. Liutauras will be a major contender tee hee

Tim Cooke wrote:Perhaps in 2018 we'll run an Advent of Excuses. Liutauras will be a major contender tee hee

Just get things done without doing some misdirection tricks from the fact that you haven't got second part done yet
That second part took me a lot longer than I had expected. My Erlang list processing and manipulation skill are a little rusty. If I'm honest my Erlang skills all over are quite poor, but I like to use these types of exercises to have a go at unfamiliar languages. Got there eventually though.

No excuses, Piet is still charging ahead on the leaderboard. Go Piet!
Solved Day 3 Part 1.

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..
Just finished it. I agree, this was pretty much harder than the first two days. Unless of course, I overlooked something obvious.

Anyway, here is my code at GitHub: https://github.com/PietSnot/AdventOfCode2017/tree/master/src/adventofcode2017
Well, much much harder. For the first Part 1 I didn't use any mathematical distance defining formulae i.e. Manhattan, not sure if that was a mistake of mine or it wasn't needed at all, but I wrote my own algorithm from scratch - worked, but felt a bit exhausted afterwards.

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..
Congratulations, Piet, you are well at the top.
Yeah, but I seem to have some formidable compatitors! Tomorrow working, meaning I have to do it in the evening, if I'm not too tired. See how it goes.

Well, in case you're not finished yet, keep on. If you solved it you will think it wasn't that difficult after all.
Not given up yet. Once I finish that - will see what's next. O just will do what I can at a slow pace.
It can be a surprising amount of work each day to get through them. Some are easier than others. For instance, I found the Day 4 puzzle (today) quite straight forward, but am still pondering the Day 3 puzzle which I might get to later on, time permitting. Like I've said before, I never get through every day but just enjoy it for what it is and do what I can.

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
Tim, I think you are saying: "once you get in, you can't get out"

In which case you may want to check leaderboard

All up to date. I went back and completed yesterday's challenge on my lunch break today. Who needs to eat anyway.
I'm still playing catch up. I doubt I'll be able to do all the challenges on top of everything else I have to do at @work and @home. Good luck to everyone doing it though. It's been fun/interesting so far. Thanks again, Tim, for letting us know about this.
Finished it. Very easy this time.

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...   
Finally cleared my backlog (Day 3 Part 2). Done again in Racket. It seems it was most difficult puzzle for me so far. I'm doubted it would have been easier with Java for me.
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.

This thread has been viewed 2683 times.

All times above are in ranch (not your local) time.
The current ranch time is
Oct 15, 2018 05:36:58.