Advent of Code 2018
-
3 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
to
23 times faster is good, right?
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Michael Mraz wrote:23 times faster is good, right?
Right
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Stephan van Hulst wrote:Sorry about that. I'll mention my solutions only after the puzzle for the next day has been released.
That's fine
These days I really can't sit down on problems instantly, except the late evening on that day, so go ahead guys discussing stuff, I know how interesting that is. I just will skim through these once notice there are details discussed.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Piet Souris wrote:Some members are not only extremely speedy, but have code that is even shorter than Scala. Amazing.
hi Michael,
welcome!
My remark was about your Perl (?) script. I don't speak Perl and I didn't understand a bit of it, but it was mighty short!
@All
I did probably the same as Stephan, only I used a StringBuilder. The whole program (reading the input, and solve parts A and B) took around 0.77 seconds.
That Tim is becoming a nuisance, closing the gap more and more....
And the Yankees are a legue too far for us mere mortals...
There are three kinds of actuaries: those who can count, and those who can't.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
It's early days yet Piet, still plenty of time for the wheels to come off my AoC wagon. #AdventOfExcuses
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Part 1 I found easiest so far of all previous days. Simply iterating over collection and then (char1 - char2).abs == 32 (get rid of both), that means it is a combination of lower/upper. Most costly operation is remove. So I see that Stack what Stephan suggested is obviously an efficient way, because the remove is always O(1), as oppose to O(n) (each time) in case of an Array or List. Anyway, I'll keep it as I have now, it is 2 seconds only. However, second part might require to change something.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I might still will do.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
See attach pic.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-

Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I'll upload my solution later, when I get my Git repo sorted out. There's still a lot of crud there from last year.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Stephan van Hulst wrote:It's tougher than the puzzles before for sure. I battled a bit with the first part, but the second part was comparatively much easier.
I just understood now the logic behind the given example. It took me about a half an hour (might even one hour) of constant looking to it.
Didn't try to implement yet, but currently it doesn't look very complicated. Will try as soon as I'm available.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
All of you deserve a Cow!
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Anyway, if you want to practise Maps and all the juggling that can come with it, then this day 6 is your chance!
To make a distinction between a normal Point and a data (input) Point, I created a PietsPoint extends Point, that only has two constructors referring to super. Don't know if that is handy, but it made the Maps a little more comprehensible.
There are three kinds of actuaries: those who can count, and those who can't.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Frits Walraven wrote:It must be good fun.
No, it isn't. Unless you solved it and watching others struggling. I'm the only one who hasn't solved yet. Started... I'm half way through in Part 1. Got all the areas of all coordinates. Except one thing - don't know yet how to rule out infinity ones
So now all can laugh, but it isn't funny for me. Liutauras Vilda wrote:...currently it doesn't look very complicated
shut up!
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Frits Walraven wrote:Although I haven't looked at the puzzles, but I just enjoy reading your posts. It must be good fun.
All of you deserve a Cow!
Thanks, Frits!
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
I wonder how Michael "I'm not a software engineer by trade but is kicking all our butts" Mraz found today's day 6 puzzle?
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-

Tim Driven Development | Test until the fear goes away
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
It was easy! Well, it meant to be easy...
Spent half an hour figuring out what is wrong with my algorithm as instead "total distance to all given coordinates of less than 10.000" I had 1.000 (one zero less), so got nothing as resulting area, and then started looking to wrong places what might be wrong. So then after noticing that got wrong figure from specs, said: "yayay, now all will be fine"!. Executed code, got result - bang! Answer is Too High! What? Well, it says "less than 10.000" not "less than or equal to 10.000", so spent another half an hour
Oh dear... all that today's misery ended finally. I have a feeling that this year is kind of a bit more difficult than last year. Or my Racket skills are better than Scala's. Missing #Racket #'N #Its #Recursion #To #Be #Honest
Tim, indeed, you beat me on this one, so now I'm behind.
As a bonus puzzle for us all, we can calculate the resulting area of the obtained stars in a whole private group, I think it shrinks slowly
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Cooke wrote:I wonder how Michael "I'm not a software engineer by trade but is kicking all our butts" Mraz found today's day 6 puzzle?
I got part 1 done correctly and ran into the bug with certain input sets failing with correct solutions. Saw the problem reported in the reddit thread so I grabbed the part 2 using a second, anonymous account I am submitting on which didn't have the bug and wrote up my part 2 solutions. When I woke up Thursday mornign the bug had been fixed and I submitted both parts successfully. (Explaining in case anyone is looking at the JSON API output and sees the timestamps on my day 6 submissions within minutes of each other.)
I pushed my code this evening. Visualizing the grid like in the example and how to place distances and transitions through each coordinate when traversing the optimal distance route between points seemed the way to go. The key was to make a grid of all the input points, measure the distances and the number of times each coordinate crossed the points between each point. Then I made a set with all the points in a 10K grid and joined the grid counts into the set.
I had to lean hard on perl's array references and tying. Learned about flattened zipping 2 arrays into a multi-dimensional array too. Was way more complicated than I had hoped.
You Java programmers got me all jealous with your varied data types in the stdlib. I have hash, array and scalar to work with because perl is the only thing I can program quickly in.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Michael Mraz wrote:Say 7 is beginning on a [ur=https://xkcd.com/323/l]Balmer Curve[/url] with the intention of making top 200 for part 1. Wish me luck.
No way to edit posts on this forum, eh? I can see how I've slipped out of the curve
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I understand what is asked in 2nd part, just the labor work looks pretty annoying. Part 1 however was easy.
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
It's verbose firstly because I jammed all classes into one file and secondly because I didn't refactor to deduplicate code. It works fast though.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Day07Puzzle
Graph
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Rewrite in progress........
Tim Driven Development | Test until the fear goes away
-
1 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Cooke wrote:Jeepers that was hard work! Satisfying to get all of Day 7 done though.
Reading through your steps2.py was a combination of "That logic makes sense" and "WTF does that do?" to me. Then I realized you were keeping track of state, for all aspects of a task, on each worker and it made a lot more sense. Less potential for array values out of synchronization when they all belong to the same object.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Michael Mraz wrote:a combination of "That logic makes sense" and "WTF does that do?"
I'll probably feel the same way tomorrow if I'm honest. I chose to use Python because I don't use it hardly ever and want to gain some more familiarity with it. I don't pretend for a second to be any good at it.
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I had:
Still can't believe it.... self confidence = Integer.MIN_VALUE;
There are three kinds of actuaries: those who can count, and those who can't.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Driven Development | Test until the fear goes away
-
2 -
-
Number of slices to send:Optional 'thank-you' note:
-
-
Definitely a fresh morning is more clever than tired night.
Yesterday I've done Part 1 in a less than opimum way, and that was the main reason why I was struggling with Part 2. Simply I was trying to accomplish 2nd part's requirements with Part 1 code, which was not well organized, in short - bad.
This morning I've deleted code and started over. This is what we suggest often, right? So took this advice myself
Watch my beauty:
Lesson learned:
Regardless, whether it is a puzzle or anything else - always pay tremendous attention to code organization. That way no puzzle is unsolvable.
I've got 2 today's puzzles to solve. Will do in an evening.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Cooke wrote:Day 8 . . . Straight forward enough, and even quite happy with the solution design too which is a rare thing.
You used a queue. I need to learn how to do that. It's more about thinking through how to process the queue as entries and nested entries are encountered. I used a recursive function to get to the metadata for the first entry and then parse backwards through all the children as they were encountered.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Liutauras Vilda wrote:Watch my beauty:
\[code=scala\]object Day7
I was going to ask what language it was as it looked a bit like Java and Groovy to me. Quoting your message revealed the code block which you labeled with the language so I got my answer. Some of the development teams I support use Scala and I had to learn sbt configuration to update their build processes. Looks interesting. I should probably learn it.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Tim Driven Development | Test until the fear goes away
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
How do you increase the Stack size? I tried java -Xss1024M, but still got the same overflow error, so that did not seem to work.
Just had a look at day 9. Looks a bit tedious, with all that marbles and placement rules. We'll see.
There are three kinds of actuaries: those who can count, and those who can't.
| Danger, 10,000 volts, very electic .... tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











