+inline const std::string square_to_string(Square s) {
+ return std::string(1, file_to_char(square_file(s)))
+ + std::string(1, rank_to_char(square_rank(s)));
+}
+
+inline bool file_is_ok(File f) {
+ return f >= FILE_A && f <= FILE_H;
+}
+
+inline bool rank_is_ok(Rank r) {
+ return r >= RANK_1 && r <= RANK_8;
+}
+
+inline bool square_is_ok(Square s) {
+ return file_is_ok(square_file(s)) && rank_is_ok(square_rank(s));
+}