08-2 fertig

This commit is contained in:
2023-12-08 14:38:37 +01:00
parent 695c7ba576
commit 457a1d4c48

View File

@@ -7,8 +7,6 @@ startzeit = time()
dic = {}
rl = ""
source = []
counter = 0
all_end_z = False
# parse input
input_file = open("input", "r")
@@ -38,19 +36,18 @@ print("Start:", source)
loops = []
for s in source:
counter = 0
zcount = 0
z_count = 0
ss = s
out = []
while zcount < 1:
x = left_or_right(counter)
counter += 1
if x == "R":
while z_count < 1:
if left_or_right(counter) == "R":
ss = dic[ss][1]
elif x == "L":
elif left_or_right(counter) == "L":
ss = dic[ss][0]
counter += 1
out.append(ss)
if ss.endswith("Z"):
zcount += 1
z_count += 1
print(s, counter)
loops.append(counter)
print(loops)
@@ -68,7 +65,7 @@ for n in loops:
if not li:
teiler_liste.append(n)
print("Teilerliste:", teiler_liste)
print("Teiler-Liste:", teiler_liste)
unique_teiler = []
for teiler in teiler_liste: