cleanup
This commit is contained in:
parent
695b77fef7
commit
873550907a
@ -74,10 +74,8 @@ def part1(lines):
|
||||
to = monkey.f
|
||||
monkeys[to].items.append(item)
|
||||
monkey.items = []
|
||||
print("-----current round", current_round)
|
||||
|
||||
counts = list(sorted([monkey.inspect_count for monkey in monkeys]))
|
||||
print(counts)
|
||||
total = counts[-1] * counts[-2]
|
||||
print(total)
|
||||
|
||||
@ -87,7 +85,6 @@ def part2(lines):
|
||||
|
||||
for current_round in range(10000):
|
||||
for monkey in monkeys:
|
||||
print(monkey)
|
||||
for item in monkey.items:
|
||||
monkey.inspect_count += 1
|
||||
if monkey.by is None:
|
||||
@ -104,14 +101,13 @@ def part2(lines):
|
||||
monkey.items = []
|
||||
|
||||
counts = list(sorted([monkey.inspect_count for monkey in monkeys]))
|
||||
print(counts)
|
||||
total = counts[-1] * counts[-2]
|
||||
print(total)
|
||||
|
||||
|
||||
def main():
|
||||
rows = [row for row in shared.load(11)]
|
||||
#part1(rows)
|
||||
part1(rows)
|
||||
part2(rows)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user