fix: correct naming
This commit is contained in:
@@ -103,7 +103,7 @@ record Point(int RowIndex, int ColIndex)
|
|||||||
|
|
||||||
record Slope(int Rise, int Run);
|
record Slope(int Rise, int Run);
|
||||||
|
|
||||||
class Line(Point start, Point end, string[] Map)
|
class Line(Point start, Point end, string[] map)
|
||||||
{
|
{
|
||||||
private readonly Slope _slope = new(end.RowIndex - start.RowIndex, end.ColIndex - start.ColIndex);
|
private readonly Slope _slope = new(end.RowIndex - start.RowIndex, end.ColIndex - start.ColIndex);
|
||||||
|
|
||||||
@@ -116,7 +116,7 @@ class Line(Point start, Point end, string[] Map)
|
|||||||
{
|
{
|
||||||
new(end.RowIndex - doubledRise, end.ColIndex - doubledRun),
|
new(end.RowIndex - doubledRise, end.ColIndex - doubledRun),
|
||||||
new(start.RowIndex + doubledRise, start.ColIndex + doubledRun),
|
new(start.RowIndex + doubledRise, start.ColIndex + doubledRun),
|
||||||
}.Where(p => p.IsOnMap(Map)).ToList();
|
}.Where(p => p.IsOnMap(map)).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Point> GetPart2Antinodes()
|
public List<Point> GetPart2Antinodes()
|
||||||
@@ -127,7 +127,7 @@ class Line(Point start, Point end, string[] Map)
|
|||||||
// start antenna back
|
// start antenna back
|
||||||
var currentPoint = start;
|
var currentPoint = start;
|
||||||
|
|
||||||
while (currentPoint.IsOnMap(Map))
|
while (currentPoint.IsOnMap(map))
|
||||||
{
|
{
|
||||||
antinodes.Add(currentPoint);
|
antinodes.Add(currentPoint);
|
||||||
currentPoint = new(currentPoint.RowIndex - _slope.Rise, currentPoint.ColIndex - _slope.Run);
|
currentPoint = new(currentPoint.RowIndex - _slope.Rise, currentPoint.ColIndex - _slope.Run);
|
||||||
@@ -137,7 +137,7 @@ class Line(Point start, Point end, string[] Map)
|
|||||||
// end antenna out
|
// end antenna out
|
||||||
currentPoint = end;
|
currentPoint = end;
|
||||||
|
|
||||||
while (currentPoint.IsOnMap(Map))
|
while (currentPoint.IsOnMap(map))
|
||||||
{
|
{
|
||||||
antinodes.Add(currentPoint);
|
antinodes.Add(currentPoint);
|
||||||
currentPoint = new(currentPoint.RowIndex + _slope.Rise, currentPoint.ColIndex + _slope.Run);
|
currentPoint = new(currentPoint.RowIndex + _slope.Rise, currentPoint.ColIndex + _slope.Run);
|
||||||
|
|||||||
@@ -155,10 +155,10 @@ partial record Robot
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public (int X, int Y) Move(int MaxX, int MaxY)
|
public (int X, int Y) Move(int maxX, int maxY)
|
||||||
{
|
{
|
||||||
PositionX = (PositionX + VelocityX + MaxX) % MaxX;
|
PositionX = (PositionX + VelocityX + maxX) % maxX;
|
||||||
PositionY = (PositionY + VelocityY + MaxY) % MaxY;
|
PositionY = (PositionY + VelocityY + maxY) % maxY;
|
||||||
|
|
||||||
return (PositionX, PositionY);
|
return (PositionX, PositionY);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user