diff --git a/AdventOfCode/AdventOfCode.csproj b/AdventOfCode/AdventOfCode.csproj
index 4f8869c..6fb9a3a 100644
--- a/AdventOfCode/AdventOfCode.csproj
+++ b/AdventOfCode/AdventOfCode.csproj
@@ -2,7 +2,7 @@
Exe
- net9.0
+ net10.0
enable
enable
diff --git a/AdventOfCode/Problems/AOC2025/Day1/SecretEntrance.cs b/AdventOfCode/Problems/AOC2025/Day1/SecretEntrance.cs
index c9f26f5..62a94fe 100644
--- a/AdventOfCode/Problems/AOC2025/Day1/SecretEntrance.cs
+++ b/AdventOfCode/Problems/AOC2025/Day1/SecretEntrance.cs
@@ -11,6 +11,8 @@ namespace AdventOfCode.Problems.AOC2025.Day1;
[ProblemInfo(2025, 1, "Secret Entrance")]
internal class SecretEntrance : Problem
{
+ public const int LOCK_SIZE = 100;
+
public int[] Input { get; set; } = [];
public override void CalculatePart1()
{
@@ -19,7 +21,7 @@ internal class SecretEntrance : Problem
foreach (var item in Input)
{
v += item;
- v = v.Mod(100);
+ v = v.Mod(LOCK_SIZE);
if (v == 0)
c++;
}
@@ -32,14 +34,23 @@ internal class SecretEntrance : Problem
var v = 50;
foreach (var item in Input)
{
+ var vStart = v;
var sign = int.Sign(item);
- for (int i = 0; i < Math.Abs(item); i++)
+ var curC = 0;
+
+ v += item;
+ if (item > 0)
+ curC += (int)Math.Floor(v / (float)LOCK_SIZE);
+ else
{
- v += sign;
- v = v.Mod(100);
- if (v == 0)
- c++;
+ var d = v / (float)LOCK_SIZE;
+ var fl = Math.Floor(d);
+ curC += (int)Math.Abs(fl) - (vStart == 0 ? 1 : 0);
+ if (fl == d)
+ curC += 1;
}
+ c += curC;
+ v = v.Mod(LOCK_SIZE);
}
Part2 = c;
}
diff --git a/AdventOfCode/Problems/AOC2025/Day1/test.out b/AdventOfCode/Problems/AOC2025/Day1/test.out
new file mode 100644
index 0000000..61a3c7f
--- /dev/null
+++ b/AdventOfCode/Problems/AOC2025/Day1/test.out
@@ -0,0 +1,8 @@
+[-100]: 1 | start: 50 v: 50
+[100]: 1 | start: 50 v: 50
+[-150]: 2 | start: 50 v: 0
+[150]: 1 | start: 0 v: 50
+[-500]: 5 | start: 50 v: 50
+[500]: 5 | start: 50 v: 50
+[-550]: 6 | start: 50 v: 0
+[550]: 5 | start: 0 v: 5
\ No newline at end of file