-//#include <sokoban.h>
-//#include <object.h>
-//#include <coord.h>
-//#include <mc.h>
-
-int main(void){
- // Mart:
- // Argument parsing
- // ./main [opts] [FILEPATH [FILEPATH ...]]
- // -o Objectbased
- // -c Coordinatebased
- // -y hYbrid
- // -h Help
- //
- // FUTURE:
- // -r Also compute the set of all reachable solution states
- // -l LURD Check if LURD is a valid path
- //
- // FILEPATH Optional input file(s)
-
- // Alex:
- // Screen reading
- // - Removing outside walls
- // - Bucket fill
- // - [tile]
- // - tile = structure {int, int, enumtile}
-
- // Both: Encoding in both schemes
-
+#include "mc.h"
+#include "sokoban.h"
+#include "uthash.h"
+
+//Global variables
+bool DEBUG = false;
+strategy strat = HYBRID;
+
+void usage(char *prg)
+{
+ fprintf(stderr,
+ "Usage:\n"
+ "\t%s [opts] [FILE [FILE [...]]]\n"
+ "\n"
+ "Options:\n"
+ "\tAll strategies are mutually exclusive\n"
+ "\t-c coordinate based strategy\n"
+ "\t-o object based strategy\n"
+ "\t-y hybrid strategy\n"
+// "\t-l LURD lURD verification strategy\n"
+// "\t-r show all positions that are a valid solution\n"
+ "\n"
+ "\t-d enable verbose debug output\n"
+ "\t-h show this help\n"
+ "\n"
+ "Positional arguments:\n"
+ "\tFILE zero or more sokoban screens\n"
+ "\t when no file is specified stdin will be used\n", prg);
+}
+
+void solve(FILE *inputstream)
+{
+ clock_t time_start_read, time_end_read;
+ clock_t time_start_encode, time_end_encode;
+
+ time_start_read = clock();
+ sokoban_screen *screen = parse_screen(inputstream);
+ if (screen == NULL) printf("Something went wrong...\n");
+ sokoban_print(screen);
+ sokoban_free(screen);
+ //parse_screen(inputstream);
+ time_end_read = clock();
+
+ time_start_encode = clock();
+ switch(strat){
+ case COORD:
+ if(DEBUG) fprintf(stderr, "Encoding coordinate based\n");
+ break;
+ case OBJECT:
+ if(DEBUG) fprintf(stderr, "Encoding object based\n");
+ break;
+ case HYBRID:
+ if(DEBUG) fprintf(stderr, "Encoding hybrid based\n");
+ break;
+ default:
+ fprintf(stderr, "Huh?");
+ exit(2);
+ }
+ time_end_encode = clock();
+