Change move_is_ok() and square_is_ok() in something useful

As is defined now is always true, tested with:

  for (long i=-1000000; i < 1000000; i++)
      if (!move_is_ok(Move(i)))
          exit(0);

Reason is that move_from() and move_to() already truncate the
input value to something in the range [0, 63] that is always
a possible square.

So change definition to something useful.

The same applies also to square_is_ok()

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-01-06 10:32:27 +01:00
parent c14dae1fa2
commit 5fc8f86a4f
3 changed files with 4 additions and 5 deletions
-1
View File
@@ -207,5 +207,4 @@ extern Move move_from_uci(const Position& pos, const std::string &str);
extern const std::string move_to_uci(Move m, bool chess960);
extern bool move_is_ok(Move m);
#endif // !defined(MOVE_H_INCLUDED)