File tree 6 files changed +44
-2
lines changed 6 files changed +44
-2
lines changed Original file line number Diff line number Diff line change
1
+ 1
2
+ 10
3
+ 100
4
+ 2024
Original file line number Diff line number Diff line change
1
+ 1
2
+ 2
3
+ 3
4
+ 2024
Original file line number Diff line number Diff line change
1
+ from GhostyUtils import aoc
2
+
3
+
4
+ def prune (number : int ) -> int :
5
+ return number % 16777216
6
+
7
+
8
+ def evolve (number : int , repeat : int = 1 ) -> int :
9
+ for r in range (repeat ):
10
+ number ^= number * 64
11
+ number = prune (number )
12
+
13
+ number ^= number // 32
14
+ number = prune (number )
15
+
16
+ number ^= number * 2048
17
+ number = prune (number )
18
+
19
+ return number
20
+
21
+
22
+ def main ():
23
+ inputs = list (map (int , aoc .read_lines ()))
24
+ print (f"p1: { sum (evolve (i , 2000 ) for i in inputs )} " )
25
+
26
+
27
+ if __name__ == "__main__" :
28
+ main ()
Original file line number Diff line number Diff line change @@ -3,10 +3,10 @@ My solutions to the yearly Advents of Code
3
3
4
4
<!-- AOC TILES BEGIN -->
5
5
<h1 align =" center " >
6
- Advent of Code - 199/490 ⭐
6
+ Advent of Code - 200/496 ⭐
7
7
</h1 >
8
8
<h1 align =" center " >
9
- 2024 - 38 ⭐ - Python
9
+ 2024 - 39 ⭐ - Python
10
10
</h1 >
11
11
<a href =" 2024/1/script.py " >
12
12
<img src =" .aoc_tiles/tiles/2024/01.png " width =" 161px " >
@@ -68,6 +68,12 @@ My solutions to the yearly Advents of Code
68
68
<a href =" 2024/20/script.py " >
69
69
<img src =" .aoc_tiles/tiles/2024/20.png " width =" 161px " >
70
70
</a >
71
+ <a href =" None " >
72
+ <img src =" .aoc_tiles/tiles/2024/21.png " width =" 161px " >
73
+ </a >
74
+ <a href =" 2024/22/script.py " >
75
+ <img src =" .aoc_tiles/tiles/2024/22.png " width =" 161px " >
76
+ </a >
71
77
<h1 align =" center " >
72
78
2023 - 47 ⭐ - Python
73
79
</h1 >
You can’t perform that action at this time.
0 commit comments