+inline const std::string square_to_string(Square s) {
+ std::string str;
+ str += file_to_char(square_file(s));
+ str += rank_to_char(square_rank(s));
+ return str;
+}
+
+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));
+}