Advertisement
regzarr

aoc8_2022

Dec 9th, 2022
931
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. # visibilityTable: [ W, E, N, S]
  2.  
  3. with open("aoc8_input.txt") as f:
  4.     lines = [line.rstrip() for line in f]
  5.     tallestTree = '0'
  6.     visibilityTable =  [[ [0, 0, 0, 0] for i in range(len(lines[0]))] for j in range(len(lines))]
  7.     for line in lines:
  8.         # from left to right
  9.         tallestTree = line[0]
  10.         for c in line[1:]:
  11.            
  12.             if (c <= tallestTree):
  13.                 #visiblity[it] = 0
  14.                 a = 0
  15.             if (c > tallestTree):
  16.                 tallestTree = c
  17.            
  18.     print(lines)
  19.     print(visibilityTable)
  20.     # for j in range(len(lines[0])):
  21.         # for it in range(len(lines)):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement