diff options
author | Kamil Kaminski <kamilkss@gmail.com> | 2011-03-14 02:30:40 -0500 |
---|---|---|
committer | Kamil Kaminski <kamilkss@gmail.com> | 2011-03-14 02:30:40 -0500 |
commit | d9012a8bbda95de5e3b7b12a135d6c42f55d86ec (patch) | |
tree | 1e5f296df7e03a12ef3ca9322184bb1bd3fb924b /klotski.h | |
parent | a06be0da905b493497749ebe8495a80e6ef26e32 (diff) | |
download | klotski-d9012a8bbda95de5e3b7b12a135d6c42f55d86ec.tar.gz klotski-d9012a8bbda95de5e3b7b12a135d6c42f55d86ec.tar.bz2 klotski-d9012a8bbda95de5e3b7b12a135d6c42f55d86ec.zip |
do some more work
Diffstat (limited to 'klotski.h')
-rw-r--r-- | klotski.h | 50 |
1 files changed, 50 insertions, 0 deletions
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 <queue> +#include <cstdio> +#include <cstdlib> +#include <cstring> +#include <ctime> + +#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<Grid> &); + +#endif + |