Package position provides functionality to work with chess positions.
It defines the Position type, which represents a square on a chessboard,
and provides methods to create, validate, and manipulate positions.
FileFromString returns a File from the specified string.
The string must be a single character from "a" to "p" (case-insensitive).
If the input is invalid, the function returns FileNull.
String returns the string representation of the file.
If the file is null or invalid, it returns an empty string.
Otherwise, it returns the alphabetic representation, e.g., "a" for FileA, "b" for FileB, and so on.
Validate checks whether the file value is within the range from FileNull to FileMax.
Returns an error if the value is invalid; otherwise returns nil.
FileNull is considered valid.
String returns the string representation of the position.
If the position is empty, it returns an empty string.
For example, Position{FileE, Rank4} will be converted to "e4".
String returns the string representation of the rank.
If the rank is null or invalid, it returns an empty string.
Otherwise, it returns the numeric representation, e.g., "1" for Rank1, "2" for Rank2, and so on.
Validate checks whether the rank value is within the range from RankNull to RankMax.
Returns an error if the value is invalid; otherwise returns nil.
RankNull is considered valid.