Declaration
public static IEnumerable<int> TranslateCoordinates(
string str,
int gridWidth = 9
)Summary
Converts a convenient coordinate notation into puzzle-grid indices.
Parameters
| string | str |
A string such as "A1-4,B-E1,E2". The letters are assumed to be columns (starting from A) while the
digits are rows (starting from 1). Ranges can be combined to create rectangles; thus, A-C1-3 generates
a 3×3 square. |
| int | gridWidth |
The width of the puzzle grid. For a standard Sudoku, this is 9. |
Returns
An array of cell indices.