Skip to content

Commit e8590e7

Browse files
committed
cosmetics
1 parent 6b228e3 commit e8590e7

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

2020/day23/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ def move(self):
9898

9999
print("initializing...")
100100

101-
cups = Cups(list(map(int, "538914762")) + list(range(10, 1000001)))
101+
cups = Cups(list(map(int, "538914762")) + list(range(10, 1_000_001)))
102102

103-
print("calculating, please wait about 70 sec...")
103+
print("calculating, please wait about 17 sec...")
104104

105-
for _ in range(10000000):
105+
for _ in range(10_000_000):
106106
cups.move()
107107

108108
print(cups.by_value[1].next.value * cups.by_value[1].next.next.value)

2021/day08/run.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ def solve(zerotonine):
3838
'abcdfg', # 9
3939
]
4040

41-
found = False
42-
4341
for p in permutations('abcdefg'):
4442
encode_table = str.maketrans('abcdefg', ''.join(p))
4543
test_digits = [ set(d.translate(encode_table)) for d in digits ]
@@ -48,10 +46,9 @@ def solve(zerotonine):
4846
break
4947
test_digits.remove(set(z))
5048
if len(test_digits) == 0:
51-
found = True
5249
break
53-
54-
assert found
50+
else:
51+
raise Exception("not found")
5552

5653
encoded_digits = [ set(d.translate(encode_table)) for d in digits ]
5754
def decoder(n):

0 commit comments

Comments
 (0)