diff --git a/sk1a/maze.c b/sk1a/maze.c index 7657e33..f3a3f0f 100644 --- a/sk1a/maze.c +++ b/sk1a/maze.c @@ -7,28 +7,32 @@ int solve_maze(char* maze,int size) { int i = 0; int p, l, h, d = 0; while(i != size*size-1){ - if (maze[i + 1] == ' ' && i % size - 1 && l != 1) { + //if (i % size - 1){l = 1;} + //else if (i < size*size - size){h = 1;} + //else if (i % size){p = 1;} + //else if (i >= size){d =1;} + if (maze[i + 1] == ' ' && l != 1) { maze[i + 1] = '*'; i++; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i + size] == ' ' /*&& i < size*size - size*/ && h != 1) { + } else if (maze[i + size] == ' ' && h != 1) { maze[i + size] = '*'; i = i + size; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i - 1] == ' ' /*&& i % size*/ && p != 1) { + } else if (maze[i - 1] == ' ' && p != 1) { maze[i - 1] = '*'; i--; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i - size] == ' ' /*&& i >= size*/ && d != 1) { + } else if (maze[i - size] == ' ' && d != 1) { maze[i - size] = '*'; i = i - size; p = 0; diff --git a/sk1a/maze.o b/sk1a/maze.o index b161152..86b7871 100644 Binary files a/sk1a/maze.o and b/sk1a/maze.o differ diff --git a/sk1a/program b/sk1a/program index b879669..1c5ad18 100644 Binary files a/sk1a/program and b/sk1a/program differ