Last active
January 3, 2016 04:59
-
-
Save lost-theory/8412918 to your computer and use it in GitHub Desktop.
my https://github.com/veltman/clmystery solution
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ #spoiler alert! | |
$ grep -rn CLUE . | |
$ for v in `grep Make: vehicles | awk '{print $2}' | sort | uniq`; do grep -rn $v interviews; done; | |
$ python | |
>>> membership_suspects = reduce(set.intersection, map(set, [[x.strip() for x in open("memberships/%s" % y).readlines()] for y in ["AAA", "Delta_SkyMiles", "Museum_of_Bash_History"]])) | |
>>> people = [x.strip().split('\t') for x in open("people").readlines() if "\t" in x] | |
>>> male_suspects = [x[0] for x in people if x[1] == "M"] | |
>>> membership_suspects.intersection(male_suspects) | |
... | |
>>> len(_) | |
42 | |
>>> license_plate_suspects = set(x.split("Owner: ")[1].split('\n')[0].strip() for x in open("vehicles").read().split("License Plate") if "L337" in x and "Blue" in x and "Honda" in x) | |
>>> membership_suspects.intersection(male_suspects).intersection(license_plate_suspects) | |
... | |
>>> len(_) | |
1 | |
>>> #i think we've got our man... | |
>>> open("streets/Dunstable_Road").readlines()[283] | |
... | |
>>> open("interviews/interview-9620713").read() | |
... | |
>>> #yep, book em danno! | |
$ less ../solution | |
$ #run the command | |
$ #YAAAAY |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment