]> git.friedersdorff.com Git - max/advent_of_code_2021.git/blob - 6_1.py
Try day 14
[max/advent_of_code_2021.git] / 6_1.py
1 """Simulate lanternfish pop growth"""
2
3 with open("6_input.txt") as f:
4     fishes = [int(x) for x in f.read().split(",")]
5
6 for day in range(256):
7     print(day)
8     for i in range(len(fishes)):
9         if fishes[i] == 0:
10             fishes[i] = 6
11             fishes.append(8)
12         else:
13             fishes[i] -= 1
14
15 print(len(fishes))