Completed first day successful

This commit is contained in:
Denis Urs Rudolph
2025-12-15 09:41:41 +01:00
commit be91c71f09
3 changed files with 4207 additions and 0 deletions

18
Day0/doorOne.py Normal file
View File

@@ -0,0 +1,18 @@
file = open('/Users/mastermito/Dev/AdventOfCode/Day0/input.txt', 'r')
#start of dial
number = 50
#counter for zeros
counter = 0
lines = file.readlines()
for line in lines:
step = int(line[1:])
direction = 1 if line.startswith('R') else -1;
number = (number + (direction * step)) % 100
print('counter:', counter)
file.close()

21
Day0/doorTwo.py Normal file
View File

@@ -0,0 +1,21 @@
file = open('/Users/mastermito/Dev/AdventOfCode/Day0/input.txt', 'r')
#start of dial
number = 50
#counter for zeros
counter = 0
lines = file.readlines()
for line in lines:
step = int(line[1:])
direction = 1 if line.startswith('R') else -1;
for singleStep in range(step):
number = number + direction
number = number % 100
if number == 0:
counter += 1
print('counter:', counter)
file.close()

4168
Day0/input.txt Normal file

File diff suppressed because it is too large Load Diff