r/adventofcode • u/daggerdragon • Dec 04 '16
SOLUTION MEGATHREAD --- 2016 Day 4 Solutions ---
--- Day 4: Security Through Obscurity ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
CONSTRUCTING ADDITIONAL PYLONS IS MANDATORY [?]
This thread will be unlocked when there are a significant number of people on the leaderboard with gold stars for today's puzzle.
edit: Leaderboard capped, thread unlocked!
17
Upvotes
View all comments
Show parent comment
3
u/AoC-- Dec 04 '16 edited Dec 04 '16
A little bit of golfing. Part 1 works OK in oK, but not in AW's k because the latter seems to give
0Nfor subtracting (or adding) a list from a dictionary (for example:("abc"!1 2 3)-2 2 2gives"abc"!0N 0N 0Ninstead of"abc"!-1 0 1). Part 2 works in both.Edit: I had
n:("north"-"a")~5#and*i@&n'26!i+s-97, but it turns out that that's the only one that begins with an"n"! And in my opinion,+/i*looks nicer than*i@&.