feat: 2025 init + day1.1

This commit is contained in:
s-prechtl 2025-12-02 14:17:40 +01:00
parent 95f74be063
commit 96b7dcec41
27 changed files with 44 additions and 0 deletions

21
2025/Day1/src/main.py Normal file
View file

@ -0,0 +1,21 @@
TOTAL_CLICKS = 100
if __name__ == '__main__':
current = 50
count = 0
with open("input.txt", "r") as f:
rotations = [{'direction': line[0], 'count': int(
line[1:])} for line in f.readlines()]
for rotation in rotations:
print(rotation)
# Convert left to right to avoid negatives
if rotation["direction"] == 'L':
rotation["count"] = TOTAL_CLICKS - rotation["count"]
current = (current + rotation["count"]) % TOTAL_CLICKS
if current == 0:
count += 1
print(count)