X-Git-Url: http://git.scottworley.com/slidingtile/blobdiff_plain/cea272cfec1cf181ca673cc9454517b6d91a4f97..3f2baedfbb6b08093ef6df37cbabc2ff15765b9f:/sliding_tile_lib.h?ds=sidebyside diff --git a/sliding_tile_lib.h b/sliding_tile_lib.h index 4d6c015..c5d0a8b 100644 --- a/sliding_tile_lib.h +++ b/sliding_tile_lib.h @@ -2,16 +2,25 @@ #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];