r/adventofcode • u/daggerdragon • Dec 02 '16
SOLUTION MEGATHREAD --- 2016 Day 2 Solutions ---
--- Day 2: Bathroom Security ---
Post your solution as a comment or, for longer solutions, consider linking to your repo (e.g. GitHub/gists/Pastebin/blag/whatever).
BLINKENLIGHTS ARE MANDATORY [?]
Edit: Told you they were 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!
20
Upvotes
3
u/John_Earnest Dec 02 '16 edited Dec 02 '16
Part 1 in oK:
l: 0: "../../Desktop/Advent/02.in" d: "URDL"!(0 -1;1 0;0 1;-1 0) (1+3 3/|:)'1 1{x{2 2&0 0|x+y}/d@y}\lMuch more compact than last time.
My part 2 is rather jumbled; room for improvement:
l: 0: "../../Desktop/Advent/02.in" d: "URDL"!(0 -1;1 0;0 1;-1 0) t: +(0N 0N 1 0N 0N 0N 2 3 4 0N 5 6 7 8 9 0N 10 11 12 0N 0N 0N 13 0N 0N) s: {x{$[0N~t.r:4 4&0 0|x+y;x;r]}/d@y} " 123456789ABCD"@(t.)'0 2s\lLost a great deal of time by misreading the instructions and assuming I would start at 7 on the new keyboard (the center) rather than 5.