Some checks reported errors
continuous-integration/drone/push Build encountered an error
24 lines
No EOL
569 B
Python
24 lines
No EOL
569 B
Python
#!/usr/bin/env python
|
|
# 2025 - Advent Of Code 1
|
|
|
|
# file = 'input_example.txt'
|
|
file = 'input.txt'
|
|
|
|
dial = 50
|
|
count = 0
|
|
with open(file, encoding="utf-8") as f:
|
|
for line in f.readlines():
|
|
direction = line[0]
|
|
distance = int(line[1:])
|
|
# print(f'{direction=}, {distance=}')
|
|
if direction == 'L':
|
|
dial -= distance
|
|
print(f'Left {dial=}')
|
|
elif direction == 'R':
|
|
dial += distance
|
|
print(f'Right {dial=}')
|
|
dial = dial % 100
|
|
if dial == 0:
|
|
count += 1
|
|
|
|
print(count) |