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