summaryrefslogtreecommitdiff
path: root/2025/aoc2025-d01.py
blob: f3e91017d98927f5da0b95775de238b543350e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#advent of code 2025
#day 01

dial=50;
part1=0;
part2=0;
bigjumps=0;
PuzzleInput=open("01.in","r");
for instruction in PuzzleInput:
	direction=1*(instruction[0]=="R") -1*(instruction[0]=="L");
	jump=int(instruction[1:]);
	for step in range(jump): #yes it's bruteforce
		dial+=direction;
		dial=(100+dial)%100;
		if dial==0: 
			part2+=1;
	part1+=dial==0;

print("part 1",part1);
print("part 2",part2);