X-Git-Url: http://git.scottworley.com/slidingtile/blobdiff_plain/cada47bfe401f2084c4248df10cdf0488bc8750a..3f2baedfbb6b08093ef6df37cbabc2ff15765b9f:/sliding_tile_lib.h?ds=inline diff --git a/sliding_tile_lib.h b/sliding_tile_lib.h index d144789..c5d0a8b 100644 --- a/sliding_tile_lib.h +++ b/sliding_tile_lib.h @@ -7,10 +7,17 @@ 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);