Initial commit

This commit is contained in:
fiveop committed 2021-12-22 11:33:30 +01:00
commit cd6cc0be1e
73 files changed
+10338

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
function solution6(n)
initial = parse.(Int, split(readline("6.data"),","))
fish = [count(initial .== i) for i in 0:8]
for _ in 1:n
fish = circshift(fish, -1)
fish[7] += fish[9]
end
sum(fish)
end
function solution6_1()
solution6(80)
end
function solution6_2()
solution6(256)
end
solution6_1(),solution6_2()