11-1 fertig

This commit is contained in:
2023-12-11 16:03:39 +01:00
parent 2f3dd824d0
commit 25175daff9
8 changed files with 350 additions and 3 deletions

View File

@@ -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)

9
10/input-ex31 Normal file
View File

@@ -0,0 +1,9 @@
...........
.S-------7.
.|F-----7|.
.||.....||.
.||.....||.
.|L-7.F-J|.
.|..|.|..|.
.L--J.L--J.
...........

10
10/input-ex41 Normal file
View File

@@ -0,0 +1,10 @@
.F----7F7F7F7F-7....
.|F--7||||||||FJ....
.||.FJ||||||||L7....
FJL7L7LJLJ||LJ.L-7..
L--J.L7...LJS7F-7L7.
....F-J..F7FJ|L7L7L7
....L7.F7||L7|.L7L7|
.....|FJLJ|FJ|F7|.LJ
....FJL-7.||.||||...
....L---J.LJ.LJLJ...