diff options
| author | bthink <bthink@fake.com> | 2025-12-07 15:59:37 +0100 |
|---|---|---|
| committer | bthink <bthink@fake.com> | 2025-12-07 15:59:37 +0100 |
| commit | ed395fe7a7fd68f6db4ea94de8fdcdcb0fac5179 (patch) | |
| tree | 68048caf0328d39083e107cb19b989001389527c /2025/aoc2025-d01.py | |
| parent | f6ff66ea2da1f30303f17a2dac341411fb325881 (diff) | |
first week of AOC 2025
Diffstat (limited to '2025/aoc2025-d01.py')
| -rw-r--r-- | 2025/aoc2025-d01.py | 20 |
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); |
