|
|
@ -20,13 +20,13 @@ class Reproduce: |
|
|
|
|
|
|
|
def start(self, days: int = 80) -> None: |
|
|
|
counts = Counter(self.times) |
|
|
|
for day in range(days): |
|
|
|
for _ in range(days): |
|
|
|
next_counts = Counter() # Can't modify while iterating |
|
|
|
|
|
|
|
for count_key, count in counts.items(): |
|
|
|
if count_key == 0: |
|
|
|
next_counts[6] += count # Move the parents back to 6 days |
|
|
|
next_counts[8] += count # Add the new fish |
|
|
|
next_counts[6] += count # Move the parents back to 6 days |
|
|
|
else: |
|
|
|
next_counts[count_key - 1] += count # Move count to next day count |
|
|
|
|
|
|
|