From d4204d5c8d9c4b69caa0023412400d046e355741 Mon Sep 17 00:00:00 2001 From: David Vereb Date: Thu, 9 Dec 2021 16:53:23 -0500 Subject: [PATCH] Commented out some testing stuff and added remainder of line to list that helps us decode. --- 2021/8/main2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/2021/8/main2.py b/2021/8/main2.py index 1f88d69..3b2485c 100644 --- a/2021/8/main2.py +++ b/2021/8/main2.py @@ -82,7 +82,7 @@ def ParsePossibilities(text): # RemoveImpossibleLetters(good_letters, good_positions) # The harder ones second: - if(text_len == 5): + # if(text_len == 5): # Could be 2, 3, or 5 # MUST contain positions 'a', 'd', and 'g' in any 5-position number # MIGHT contain positions 'b' and 'f' for FIVE @@ -91,7 +91,7 @@ def ParsePossibilities(text): # if one of them is found with two others, it's either c or f # if one of them is not found with two others, it could be b or e - if(text_len == 6): + # if(text_len == 6): # Could be 0, 6, or 9 # MUST contain positions 'a', 'b', 'f', and 'g' in any 6-position number # MIGHT contain positions 'c' and 'd' for NINE @@ -108,6 +108,7 @@ with open('example_data', 'r') as fp: data = split_line[0].split() # print(data) codes = split_line[1] + data += codes for val in codes.split(): if(len(val) in [2, 3, 4, 7]): total += 1