From b1264328df60ebe85fe5a014106a3f1092719337 Mon Sep 17 00:00:00 2001 From: CptG9000 <71446401+CptG9000@users.noreply.github.com> Date: Tue, 7 Dec 2021 02:29:48 +0000 Subject: [PATCH 1/1] Create 6.py --- Gareth solution Python/6.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Gareth solution Python/6.py diff --git a/Gareth solution Python/6.py b/Gareth solution Python/6.py new file mode 100644 index 0000000..cbfd5f4 --- /dev/null +++ b/Gareth solution Python/6.py @@ -0,0 +1,18 @@ +#it is very not efficient for pt2 but I didn't have much time today to think of a better solution +fish = [2,3,1,3,4,4,1,5,2,3,1,1,4,5,5,3,5,5,4,1,2,1,1,1,1,1,1,4,1,1,1,4,1,3,1,4,1,1,4,1,3,4,5,1,1,5,3,4,3,4,1,5,1,3,1,1,1,3,5,3,2,3,1,5,2,2,1,1,4,1,1,2,2,2,2,3,2,1,2,5,4,1,1,1,5,5,3,1,3,2,2,2,5,1,5,2,4,1,1,3,3,5,2,3,1,2,1,5,1,4,3,5,2,1,5,3,4,4,5,3,1,2,4,3,4,1,3,1,1,2,5,4,3,5,3,2,1,4,1,4,4,2,3,1,1,2,1,1,3,3,3,1,1,2,2,1,1,1,5,1,5,1,4,5,1,5,2,4,3,1,1,3,2,2,1,4,3,1,1,1,3,3,3,4,5,2,3,3,1,3,1,4,1,1,1,2,5,1,4,1,2,4,5,4,1,5,1,5,5,1,5,5,2,5,5,1,4,5,1,1,3,2,5,5,5,4,3,2,5,4,1,1,2,4,4,1,1,1,3,2,1,1,2,1,2,2,3,4,5,4,1,4,5,1,1,5,5,1,4,1,4,4,1,5,3,1,4,3,5,3,1,3,1,4,2,4,5,1,4,1,2,4,1,2,5,1,1,5,1,1,3,1,1,2,3,4,2,4,3,1] +day = 0 +index = 0 +while True: + if day == 256: + break + if index == len(fish): + index = 0 + day = day + 1 + print("Day",day) + if fish[index] == 0: + fish[index] = 6 + fish.append(9) + elif fish[index]!=0: + fish[index]= fish[index]-1 + index = index + 1 +print("Number fo fish ",len(fish)) \ No newline at end of file -- 2.39.2