From 7e0dbe9efdcdc675ac46a416c39f432a01ad6bcb Mon Sep 17 00:00:00 2001 From: Rasmus Malver Date: Thu, 8 Dec 2022 15:26:12 +0100 Subject: [PATCH] Christmas egg --- 08/2022-12-08-A.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/08/2022-12-08-A.py b/08/2022-12-08-A.py index fff2d69..229ff22 100644 --- a/08/2022-12-08-A.py +++ b/08/2022-12-08-A.py @@ -10,10 +10,10 @@ for y in range(1,np.shape(a)[0]-1): # Visible? left = True if len(list(np.where(a[y][0:x]>=a[y][x])[0]))<1 else False right = True if len(list(np.where(a[y][x:] >=a[y][x])[0][1:]))<1 else False - top = True if len(list(np.where(a[:,x][0:y]>=a[y,x])[0]))<1 else False - bottom = True if len(list(np.where(a[:,x][y:]>=a[y,x])[0][1:]))<1 else False + aktiv = True if len(list(np.where(a[:,x][0:y]>=a[y,x])[0]))<1 else False + passiv = True if len(list(np.where(a[:,x][y:]>=a[y,x])[0][1:]))<1 else False - if left or right or top or bottom: + if left or right or aktiv or passiv: visible+=1 print(visible)