]>
git.scottworley.com Git - slidingtile/blob - sliding_tile_lib.h
c5d0a8bc66c99b7480d06a1c2b96811de9bbe6b6
1 #ifndef _SLIDING_TILE_LIB_H
2 #define _SLIDING_TILE_LIB_H
7 const int BOARD_DIM
= 4;
8 const int BOARD_SIZE
= BOARD_DIM
* BOARD_DIM
;
10 struct InvertedBoard
{
11 signed char pos
[BOARD_SIZE
];
15 signed char board
[BOARD_SIZE
];
16 bool is_valid() const;
17 signed char hole() const;
18 InvertedBoard
invert() const;
19 int distance(const Board
& o
) const;
20 int distance(const InvertedBoard
& invo
) const;
22 std::istream
& operator>>(std::istream
& is
, Board
& board
);
23 std::ostream
& operator<<(std::ostream
& os
, const Board
& board
);
25 extern signed char adjacent
[BOARD_SIZE
][5];
27 #endif /* _SLIDING_TILE_LIB_H */