cleanup
This commit is contained in:
@@ -25,11 +25,11 @@ internal class GearRatios : Problem<int, int>
|
|||||||
for (int x = 0; x <= _width; x++)
|
for (int x = 0; x <= _width; x++)
|
||||||
{
|
{
|
||||||
var cell = _data[y][x];
|
var cell = _data[y][x];
|
||||||
switch (cell - '0')
|
switch (cell)
|
||||||
{
|
{
|
||||||
case '.' - '0':
|
case '.':
|
||||||
continue;
|
continue;
|
||||||
case < 0 or > 9:
|
case < '0' or > '9':
|
||||||
FindNumbers(x, y, ref partNumbers);
|
FindNumbers(x, y, ref partNumbers);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -66,9 +66,9 @@ internal class GearRatios : Problem<int, int>
|
|||||||
var numEnd = _width + 1;
|
var numEnd = _width + 1;
|
||||||
for (int i = x; i >= 0; i--)
|
for (int i = x; i >= 0; i--)
|
||||||
{
|
{
|
||||||
switch (row[i] - '0')
|
switch (row[i])
|
||||||
{
|
{
|
||||||
case < 0 or > 9:
|
case < '0' or > '9':
|
||||||
numStart = i + 1;
|
numStart = i + 1;
|
||||||
goto leftDone;
|
goto leftDone;
|
||||||
}
|
}
|
||||||
@@ -76,9 +76,9 @@ internal class GearRatios : Problem<int, int>
|
|||||||
leftDone:
|
leftDone:
|
||||||
for (int i = x; i <= _width; i++)
|
for (int i = x; i <= _width; i++)
|
||||||
{
|
{
|
||||||
switch (row[i] - '0')
|
switch (row[i])
|
||||||
{
|
{
|
||||||
case < 0 or > 9:
|
case < '0' or > '9':
|
||||||
numEnd = i;
|
numEnd = i;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user