X-Git-Url: http://git.scottworley.com/slidingtile/blobdiff_plain/f92e9dcac70dc0859e1cf176b84b39c42f677e3e..1955dd8bceb1bd5beef449ff1ac04c35c2714f31:/sliding_tile_lib.h diff --git a/sliding_tile_lib.h b/sliding_tile_lib.h index 1b56da4..11d9de3 100644 --- a/sliding_tile_lib.h +++ b/sliding_tile_lib.h @@ -4,6 +4,7 @@ #include #include #include +#include #include const int BOARD_DIM = 4; @@ -28,12 +29,22 @@ std::istream& operator>>(std::istream& is, Board& board); std::ostream& operator<<(std::ostream& os, const Board& board); struct Step { + Step(Board board, std::shared_ptr prev); + ~Step(); + Board board; std::shared_ptr prev; - std::vector successors(std::shared_ptr shared_this) const; + + std::vector> successors(std::shared_ptr shared_this) const; + int length() const; + int cost(const InvertedBoard& invgoal) const; + static signed char adjacent[BOARD_SIZE][5]; + static int count; }; std::ostream& operator<<(std::ostream& os, const Step& step); +std::shared_ptr find_path(const std::string& start, const std::string& goal); +std::shared_ptr find_path(const Board& start, const Board& goal); #endif /* _SLIDING_TILE_LIB_H */