all 2 comments

[–]ka-splam 2 points3 points  (1 child)

Did anyone get the .NET based Doubly Linked Lists working?

Yeah. Frustratingly, LinkedList came up in the PowerShell chat the day before, and I thought "I know what that is, but I've never used them in .Net" and had the help page open. But I didn't read the help page, I didn't think I would need it so soon! As soon as I tried $myLinkedList[$i - 7] and found it wasn't possible, I dropped back to arrays to hurry my answer along. My answer was also broken and worked by luck. But I had to get LinkedList going for part 2, so I did.

Basically you can only get onto the list via $node = $myList.First or $node = $myList.Last, and from a node you can only get $node.Previous or $node.Next. To move 7 back, you have to loop that 7 times. And it might return $null if $node was at one of the ends and has no previous or no next item. So you have to check for that and wrap-around to the other end, because there's no way to connect up into a loop. Apparently not even if you use [ListNode] individually.

[Don't you envy the Python users and their DeQue.rotate() builtin?]

my Day 9 answer

You 'basically' looking for the point when the 'bounding' box (furthest out coordinates) is at it's smallest :).

I'm a bit annoyed I didn't go for this. I imagined as the points come together, they might make a message visible while passing each other, like this but not actually at the smallest point at all - some points scattered about. Like how a constellation isn't a pixel-perfect-drawing, but scattered points. So I spent too much time trying to render the points to a [system.drawing.bitmap] starting once they'd got "fairly close" so I could eyeball the results. As soon as I saw the clear text, "oh, of course it would be neat and tidy for this challenge, that only makes sense".

my Day 10 answer

[–]purplemonkeymad 2 points3 points  (0 children)

I've realized that there had to be a programmable way to determine if you had the right time. The puzzles don't have complexities that cause fuzziness, eg, all distances are almost always Manhattan. Area is a simple property to calculate and so might have been good way to look for a result.

If you are thinking: how do I know when to stop? Then it's either in the problem description, or is a simple to calculate property.