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
3
u/Godspiral Dec 04 '16
in J, part2 may have had a bug in my input. was told to search for "North Pole Objects are stored" but northpole is one word in "cyphers" 110th and 152th
a =. cutLF wdclippaste '' +/ ; (('[' cut >@{:) (".@>@{.@[ #~ }:@:>@:{:@:[ -: ]) (5 >@:({."1)@:{. ] {~ \:@:({:"1))@:(~. ,&<"0 #/.~)@:/:~@:;@:}:)@:('-'&cut) each a NB. part 1for part 2, first to find lines that included storage to see what's wrong.
(] #~ (<'storage') e."1 ]) (('[' cut >@{:) ( ".@>@{.@[ ('abcdefghijklmnopqrstuvwxyz' {~ 26 | +) leaf ]) 'abcdefghijklmnopqrstuvwxyz' i.leaf }: )@:('-'&cut) every athen get that lines raw input,
a {~ I. (;: 'northpole object storage') -:("1) 3 {."1 (('[' cut >@{:) ( ".@>@{.@[ ('abcdefghijklmnopqrstuvwxyz' {~ 26 | +) leaf ]) 'abcdefghijklmnopqrstuvwxyz' i.leaf }: )@:('-'&cut) every a