cleanup
This commit is contained in:
parent
fcb1f741b9
commit
ce95630cc6
4 changed files with 28 additions and 17 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue