diff --git a/sk1a/main.c b/sk1a/main.c index 7d3bac0..65f2025 100644 --- a/sk1a/main.c +++ b/sk1a/main.c @@ -1,4 +1,4 @@ -#define SZ 2 +#define SZ 10 #include #include #include "maze.h" @@ -14,8 +14,16 @@ void print_solution(char* matrix,int sz){ int main(){ char tmaze[SZ+1][SZ+1]={ - "* ", - " " + "* ", + "x x xx ", + " xxx ", + " x x ", + " x x", + "xxxxxxx ", + " ", + "x xxxxxxxx", + " xx ", + " xx " }; char maze[SZ*SZ]; memset(maze,' ',SZ*SZ); diff --git a/sk1a/main.o b/sk1a/main.o index b67a4f1..081eb03 100644 Binary files a/sk1a/main.o and b/sk1a/main.o differ diff --git a/sk1a/maze.c b/sk1a/maze.c index cff6af7..28eece8 100644 --- a/sk1a/maze.c +++ b/sk1a/maze.c @@ -5,7 +5,7 @@ #include int paths(char* maze, int journey, int size){ - printf("journy je:%d\n",journey); + //printf("index: %d\n",journey); if(journey == size*size-1){ maze[journey]= '*'; @@ -18,7 +18,6 @@ int paths(char* maze, int journey, int size){ //Pohyb dole if(journey < (size * size) - (size)){ - puts("dole"); if(paths(maze, journey+size, size)){ return 1; } @@ -27,7 +26,6 @@ int paths(char* maze, int journey, int size){ //Pohyb vpravo if((journey+1)%size!=0) { - puts("vpravo"); if (paths(maze, journey + 1, size)) { return 1; } @@ -37,14 +35,13 @@ int paths(char* maze, int journey, int size){ if(paths(maze, journey-size, size)){ return 1; } - +/* //Pohyb vlavo - if((journey%size)!=0){ - puts("vlavo"); + if((size%journey)!=0){ if(paths(maze, journey-1, size)) return 1; } - +*/ maze[journey] = ' '; return 0; } diff --git a/sk1a/maze.o b/sk1a/maze.o index eac353e..e95d95e 100644 Binary files a/sk1a/maze.o and b/sk1a/maze.o differ diff --git a/sk1a/program b/sk1a/program index dbdbbc9..b3aacba 100755 Binary files a/sk1a/program and b/sk1a/program differ