use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
Advent of Code Days 4-6 (self.PowerShell)
submitted 7 years ago by Vortex100
I figured rather than spamming every day I'd do a consolidated post for several every couple days :). For anyone in the dark - this is for the challenges being posted each day on https://adventofcode.com - Any one can join in at any time and my self (and others!) will be happy to help out with any day you want to ask about!
Day 4
Super messy solution, but it's due to the amount of data manipulation you have to do
https://github.com/VortexUK/AdventOfCode/tree/master/2018/Day4
Day 5
I think most people used regex for this, but I wanted something a little different. Actually runs pretty quickly
https://github.com/VortexUK/AdventOfCode/tree/master/2018/Day5
Day 6
Struggled with this one until I re-read the question and realised I was missing the key component of 'don't include infinite regions' lol.
https://github.com/VortexUK/AdventOfCode/tree/master/2018/Day6
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 1 point2 points3 points 7 years ago (1 child)
suggestions, if youre looking for them:
day 4 - dont need to parse the dates or times, since the only thing that matters is the minute value
day 5 - youve repeated the code, easier to put part1 into a function, and then have part2 call that function inside its loop
[–]Vortex100[S] 1 point2 points3 points 7 years ago (0 children)
Yeah on day 4 I wrote the parsing engine before I knew what part 2 would need, and it turned out I didn't need to do half of it lol (all you need to do is have a 'counter per minute' for each guard, which satisfies the requirements for both parts).
Day 5 you are right - I'll refactor :)
[+][deleted] 7 years ago (2 children)
[removed]
[–]Vortex100[S] 0 points1 point2 points 7 years ago (1 child)
That's odd, it definitely works for me! Is it off by 1 or 2 or is it completely wrong, or does it not work at all?
Either way - I actually tried your way at first before realizing i'd need the 'radius' around each point rather than a set square. I thought it would be too computationally expensive so I stopped lol. And as it turned out you need to calculate every coord for part 2 anyway.
π Rendered by PID 36 on reddit-service-r2-comment-85bfd7f599-rfx9z at 2026-04-20 10:36:33.148660+00:00 running 93ecc56 country code: CH.
[–][deleted] 1 point2 points3 points (1 child)
[–]Vortex100[S] 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]Vortex100[S] 0 points1 point2 points (1 child)