This commit is contained in:
Meizar 2025-08-01 06:36:02 +07:00
parent fcb1f741b9
commit ce95630cc6
4 changed files with 28 additions and 17 deletions

View file

@ -11,20 +11,7 @@ internal record Coordinate
public Coordinate(string name)
{
Name = name;
int row = 0;
int col = 0;
foreach (var item in name)
{
if (item >= 'A')
{
row = row * 26 + (item - 'A' + 1);
}
else if (item >= '0')
{
col = col * 10 + (item - '0');
}
}
(int row, int col) = Helper.ToRowCol(name);
Row = row;
Col = col;
}