#pragma once

		// the data type used to represent a card
typedef unsigned char card;

		// a hole is internally represented as a card with number 0
const card kHole = 0;

enum
{
	kMoveUp,
	kMoveDown,
	kMoveLeft,
	kMoveRight
};

class SolutionWindow;

	// the class Board represents a game in a specific state
class Board
{
public:

						// read the state from a file
			Board(const char *filename);

			Board();	// create the "default board"

	void	ShowSolutionWindow();


						// returns true if the board is solvable
						// The algorithm is described by the comments in 02Board.cpp
	bool	IsSolvable(Board *final);

private:
					//x  y
	card	cards[4][4];

	SolutionWindow	*itsSolutionWindow;
						// find the specified card and return its
						// position on the board in x and y
	void	GetCardPosition(card card,int& x, int& y);

						// Execute a move
	void	Move(int move);			// move is the direction (kMove* constant)
	void	Move(int dx,int dy);	// dx and dy specify the direction

};
