Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: IEnumerable<int> TranslateCoordinates(this string, int)

Declaration

public static IEnumerable<int> TranslateCoordinates(
    this string str,
    int gridWidth = 9
)

Summary

Converts a convenient coordinate notation into puzzle-grid indices.

Parameters

this stringstr 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.
intgridWidth The width of the puzzle grid. For a standard Sudoku, this is 9.

Returns

An array of cell indices.