]> git.scottworley.com Git - slidingtile/blob - sliding_tile_lib.h
operator<< for printing for debugging
[slidingtile] / sliding_tile_lib.h
1 #ifndef _SLIDING_TILE_LIB_H
2 #define _SLIDING_TILE_LIB_H
3
4 #include <istream>
5 #include <ostream>
6
7 const int BOARD_DIM = 4;
8 const int BOARD_SIZE = BOARD_DIM * BOARD_DIM;
9
10 struct Board {
11 signed char board[BOARD_SIZE];
12 bool is_valid() const;
13 signed char hole() const;
14 };
15 std::istream& operator>>(std::istream& is, Board& board);
16 std::ostream& operator<<(std::ostream& os, const Board& board);
17
18 extern signed char adjacent[BOARD_SIZE][5];
19
20 #endif /* _SLIDING_TILE_LIB_H */