This commit is contained in:
2025-12-01 19:50:56 +01:00
commit 774df0c7f0
4 changed files with 4355 additions and 0 deletions

28
01/01-1.py Normal file
View File

@@ -0,0 +1,28 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# file = "./ex.txt"
file = "./input.txt"
def turn_lock(direction:str, steps:int, pos:int) -> int:
if direction == "R":
pos += steps
while pos >= 100:
pos -= 100
else:
pos -= steps
while pos < 0:
pos += 100
return pos
if __name__ == "__main__":
solution, position = 0, 50
input_file = open(file, "r")
for line in input_file:
line = line.strip()
if line == "":
continue
position = turn_lock(line[0], int(line[1:]), position)
if position == 0:
solution += 1
print(f"The Password is: {solution}")

10
01/ex.txt Normal file
View File

@@ -0,0 +1,10 @@
L68
L30
R48
L5
R60
L55
L1
L99
R14
L82

4317
01/input.txt Normal file

File diff suppressed because it is too large Load Diff

0
requirements.txt Normal file
View File