finished setbyfen
This commit is contained in:
1 parent
69a7855f96
commit
ad6ee77a46
2 files changed
+22
-3
No files matched your search
+10
-1
@@ -16,4 +16,13 @@ std::vector<std::string> split(std::string_view str, char delim) {
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
||||
int parseSquare(std::string_view str) {
|
||||
constexpr std::string_view files = "abcdefgh";
|
||||
|
||||
int file = files.find(str[0]);
|
||||
int rank = str[1] - '0';
|
||||
|
||||
return file + rank * 8;
|
||||
}
|
||||
Reference in new issue
Block a user