File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ public string Solve()
19
19
this . LocationsToTry . Enqueue ( root ) ;
20
20
while ( this . LocationsToTry . Peek ( ) != null )
21
21
{
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 ) ;
24
24
foreach ( var neighbor in neighbors )
25
25
{
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 )
29
29
{
30
30
return nextLocation ;
31
31
}
Original file line number Diff line number Diff line change 1
- 3
1
+ 4
2
2
0 +1
3
3
+2 +2
You can’t perform that action at this time.
0 commit comments