summaryrefslogtreecommitdiffstats
path: root/klotski.h
diff options
context:
space:
mode:
Diffstat (limited to 'klotski.h')
-rw-r--r--klotski.h50
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
+