summaryrefslogtreecommitdiff
path: root/2025/aoc2025-d01.py
diff options
context:
space:
mode:
Diffstat (limited to '2025/aoc2025-d01.py')
-rw-r--r--2025/aoc2025-d01.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/2025/aoc2025-d01.py b/2025/aoc2025-d01.py
new file mode 100644
index 0000000..f3e9101
--- /dev/null
+++ b/2025/aoc2025-d01.py
@@ -0,0 +1,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);