Skip to content

Commit 33c53b1

Browse files
committed
Simpler test
1 parent 412f3d9 commit 33c53b1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Week 1/Luke/CalcMaze/Puzzle.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ public string Solve()
1919
this.LocationsToTry.Enqueue(root);
2020
while (this.LocationsToTry.Peek() != null)
2121
{
22-
var next = this.LocationsToTry.Dequeue();
23-
var neighbors = GetValidNeighbors(next.Location.X, next.Location.Y);
22+
var currentLocation = this.LocationsToTry.Dequeue();
23+
var neighbors = GetValidNeighbors(currentLocation.Location.X, currentLocation.Location.Y);
2424
foreach (var neighbor in neighbors)
2525
{
26-
double nextCalc = DoCalc(next.CurrentCalc, neighbor);
27-
string nextLocation = next.Path + " " + neighbor.X + "," + neighbor.Y;
28-
if (nextCalc == this.Goal && neighbor.X == Map[0].Count && neighbor.Y == Map.Count)
26+
double nextCalc = DoCalc(currentLocation.CurrentCalc, neighbor);
27+
string nextLocation = currentLocation.Path + " " + neighbor.X + "," + neighbor.Y;
28+
if (nextCalc == this.Goal && neighbor.X == Map[0].Count - 1 && neighbor.Y == Map.Count - 1)
2929
{
3030
return nextLocation;
3131
}

Week 1/Tests/Input0.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
3
1+
4
22
0 +1
33
+2 +2

0 commit comments

Comments
 (0)