|
On it! I'm always indecisive about whether I want to use these as opportunities to try to work with a new programming language or not. Usually I start with trying to write it in [Flavor Of The Week], bang my head on the desk for an hour, then give up and write it in Python in 5 minutes.
|
# ¿ Dec 4, 2015 22:17 |
|
|
# ¿ May 12, 2024 05:10 |
|
Day 5: REGULAR EXPRESSIONS
|
# ¿ Dec 5, 2015 15:14 |
|
Hughmoris posted:I've looked at it every which way but I'm clueless on how to go about solving Day 4. Here is how I solved it in Python: https://github.com/erhudy/adventofcode-solutions/blob/master/problem4.py Basically you need to concatenate the given key to the string form of a monotonically increasing integer, hash it with whatever MD5 function Perl 6 provides that will give you back a string, and check the start of the string for "00000". If not, increment the integer and try again. E.g., if your key is "abcdef", you would MD5 hash "abcdef0", check the hex output for a start of "00000", then try "abcdef1", "abcdef2", and so forth. Googling around, it looks like actually doing the hashing in Perl 6 might be a pain. You can shell out and use md5/md5sum (just be sure to strip newlines): code:
code:
chutwig fucked around with this message at 04:04 on Dec 6, 2015 |
# ¿ Dec 6, 2015 03:57 |
|
Finally had time to return to the problems after a busy December and restart all the way back at problem 7. Having it laid bare that I'm a systems programmer with little knowledge of algorithms is teeth-gritting sometimes, but that makes it all the more gratifying when I get the solution.
|
# ¿ Dec 26, 2015 22:28 |
|
Volguus posted:Welcome, you're gonna have a lot of fun (until Day 19, drat that day). But, I'm just curious, what does "systems programmer with little knowledge of algorithms" means? From what I know, systems programming still is programming (with a different focus), where algorithms are just as prevalent and as important (if not more so) than application programming. Sorry, I don't mean systems like low level C/assembly guy. I mean I'm the sysadmin who knows Python who winds up gluing other projects together for deployments, monitoring, that kind of stuff. Describing it as "systems programming" was not the right choice of words. chutwig fucked around with this message at 03:08 on Dec 28, 2015 |
# ¿ Dec 28, 2015 03:03 |