Commented out some testing stuff and added remainder of line to list that helps us decode.
This commit is contained in:
parent
443b33e863
commit
d4204d5c8d
@ -82,7 +82,7 @@ def ParsePossibilities(text):
|
|||||||
# RemoveImpossibleLetters(good_letters, good_positions)
|
# RemoveImpossibleLetters(good_letters, good_positions)
|
||||||
|
|
||||||
# The harder ones second:
|
# The harder ones second:
|
||||||
if(text_len == 5):
|
# if(text_len == 5):
|
||||||
# Could be 2, 3, or 5
|
# Could be 2, 3, or 5
|
||||||
# MUST contain positions 'a', 'd', and 'g' in any 5-position number
|
# MUST contain positions 'a', 'd', and 'g' in any 5-position number
|
||||||
# MIGHT contain positions 'b' and 'f' for FIVE
|
# 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 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 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
|
# Could be 0, 6, or 9
|
||||||
# MUST contain positions 'a', 'b', 'f', and 'g' in any 6-position number
|
# MUST contain positions 'a', 'b', 'f', and 'g' in any 6-position number
|
||||||
# MIGHT contain positions 'c' and 'd' for NINE
|
# MIGHT contain positions 'c' and 'd' for NINE
|
||||||
@ -108,6 +108,7 @@ with open('example_data', 'r') as fp:
|
|||||||
data = split_line[0].split()
|
data = split_line[0].split()
|
||||||
# print(data)
|
# print(data)
|
||||||
codes = split_line[1]
|
codes = split_line[1]
|
||||||
|
data += codes
|
||||||
for val in codes.split():
|
for val in codes.split():
|
||||||
if(len(val) in [2, 3, 4, 7]):
|
if(len(val) in [2, 3, 4, 7]):
|
||||||
total += 1
|
total += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user