You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
584 B

fish = [int(i) for i in open("input.txt", 'r').read().split(",")]
fishies = {}
newFishies = {}
for i in range(9):
fishies[i] = 0
newFishies[i] = 0
for f in fish:
fishies[f] += 1
for i in range(int(input("days: "))):
tempFish = fishies.copy()
fishies[6] = fishies[0]+newFishies[0]
for j in range(6):
fishies[j] = tempFish[j+1]
foo = tempFish[0]
tempFish = newFishies.copy()
newFishies[8] = foo + newFishies[0]
for j in range(8):
newFishies[j] = tempFish[j+1]
summa = 0
for x in fishies:
summa += fishies[x]
for x in newFishies:
summa += newFishies[x]
print(summa)