11-1 fertig
This commit is contained in:
@@ -5,7 +5,7 @@ part_sum = 0
|
||||
matrix = []
|
||||
|
||||
# read matrix like day 3
|
||||
input_file = open("input", "r")
|
||||
input_file = open("input-ex41", "r")
|
||||
for line in input_file:
|
||||
matrix.append(line.strip())
|
||||
input_file.close()
|
||||
@@ -71,12 +71,13 @@ def where_to_go(z, s, pre):
|
||||
|
||||
|
||||
previous = (start[0], start[1])
|
||||
aktuell = [start[0]-1, start[1]]
|
||||
aktuell = [start[0], start[1]+1]
|
||||
count = 1
|
||||
|
||||
while True:
|
||||
new = where_to_go(aktuell[0], aktuell[1], previous)
|
||||
print(aktuell, previous, new)
|
||||
matrix[aktuell[0]] = matrix[aktuell[0]][:aktuell[1]] + "X" + matrix[aktuell[0]][aktuell[1]+1:]
|
||||
if new == "Ende":
|
||||
break
|
||||
else:
|
||||
@@ -87,3 +88,6 @@ while True:
|
||||
print("Counter:", count)
|
||||
print("HalfCounter:", count/2)
|
||||
|
||||
for i in matrix:
|
||||
print(i)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user