Skip to content

Commit c324a1c

Browse files
committed
cosmetics
1 parent 3fa0efa commit c324a1c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

2022/day11/run.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class Monkey:
2727
test_false: int
2828
inspected: int = 0
2929

30-
@staticmethod
31-
def from_text(lines):
30+
@classmethod
31+
def from_text(cls, lines):
3232
for line in lines:
3333
if line.startswith('Monkey '):
3434
num = int(line.split(' ')[1][:-1])
@@ -48,7 +48,7 @@ def new_value(op1, op, op2, old_value):
4848
test_true = int(line.split(' to monkey ')[1])
4949
elif line.startswith(' If false: throw to monkey '):
5050
test_false = int(line.split(' to monkey ')[1])
51-
return Monkey(num, items, partial(new_value, op1, op, op2), test_div, test_true, test_false)
51+
return cls(num, items, partial(new_value, op1, op, op2), test_div, test_true, test_false)
5252

5353
def turn(self, monkeys, divisor):
5454
while self.items:

0 commit comments

Comments
 (0)