File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
#Import input from file as a list
2
- source = open ('input .txt' ).readlines ()
2
+ source = open ('example_input .txt' ).readlines ()
3
3
4
4
#Remove linebreaks from list
5
5
for i in range (len (source )):
49
49
low = False
50
50
#Check if it is a low point
51
51
if low == True :
52
- low_points .append (heightmap [row ][value ])
52
+ low_points .append (row )
53
+ low_points .append (value )
54
+ #low_points is now a list of integers that form the coordinates of all the low points
53
55
54
- #Add one to each point and sum
55
- for i in range (len (low_points )):
56
- low_points [i ] += 1
56
+ for low_point in range (0 , len (low_points ), 2 ):
57
+
57
58
58
- #Result = 539
59
- print (sum (low_points ))
59
+ #Check a cell, if there is no 9, check that cell, keep going until you have no cells to check
You can’t perform that action at this time.
0 commit comments