X-Git-Url: http://git.scottworley.com/slidingtile/blobdiff_plain/82d6eed523b5c102d826b66e21c03f5577199714..33bb98f505ab425f693f1e8a6a1bb694a83dff92:/sliding_tile_lib.h?ds=sidebyside diff --git a/sliding_tile_lib.h b/sliding_tile_lib.h index 7e6004b..c5d0a8b 100644 --- a/sliding_tile_lib.h +++ b/sliding_tile_lib.h @@ -1,8 +1,27 @@ #ifndef _SLIDING_TILE_LIB_H #define _SLIDING_TILE_LIB_H +#include +#include + const int BOARD_DIM = 4; const int BOARD_SIZE = BOARD_DIM * BOARD_DIM; + +struct InvertedBoard { + signed char pos[BOARD_SIZE]; +}; + +struct Board { + signed char board[BOARD_SIZE]; + bool is_valid() const; + signed char hole() const; + InvertedBoard invert() const; + int distance(const Board& o) const; + int distance(const InvertedBoard& invo) const; +}; +std::istream& operator>>(std::istream& is, Board& board); +std::ostream& operator<<(std::ostream& os, const Board& board); + extern signed char adjacent[BOARD_SIZE][5]; #endif /* _SLIDING_TILE_LIB_H */