From d9012a8bbda95de5e3b7b12a135d6c42f55d86ec Mon Sep 17 00:00:00 2001 From: Kamil Kaminski Date: Mon, 14 Mar 2011 02:30:40 -0500 Subject: do some more work --- klotski.h | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 klotski.h (limited to 'klotski.h') diff --git a/klotski.h b/klotski.h new file mode 100644 index 0000000..60b9108 --- /dev/null +++ b/klotski.h @@ -0,0 +1,50 @@ +#ifndef _KLOTSKI_H +#define _KLOTSKI_H_ + +#include +#include +#include +#include +#include + +#include "grid.h" +#include "piece.h" + +using std::vector; +using std::queue; + +extern string err_msg[4]; +extern string piece_tag[]; + +/* check if Z piece spans last column */ +bool checkSoln(Grid); + +/* validate piece */ +int checkPiece(int, int, Piece); + +/* take in a grid and return a string representation of it */ +string *fillBoard(Grid); + +/* take 1D grid, create 1D representation of it, and print it */ +void printGrid(Grid); + +/* load grid from a file */ +Grid loadGrid(char **); + +/* can piece move to left? If so, have many spaces */ +int canMoveLeft(string [], int, int, Piece); + +/* can piece move to right? If so, have many spaces */ +int canMoveRight(string [], int, int, Piece); + +/* can piece move up? If so, have many spaces */ +int canMoveUp(string [], int, int, Piece); + +/* can piece move down? If so, have many spaces */ +int canMoveDown(string [], int, int, Piece); + +/* fill in a queue with grids to be checked */ +int possibleMoves(Grid, queue &); + +#endif + -- cgit v1.2.3