This commit is contained in:
Damián Korpesio 2022-01-03 15:54:09 +01:00
parent 29107acfc3
commit 7bcfc31c4c
4 changed files with 19 additions and 2 deletions

Binary file not shown.

View File

@ -3,6 +3,23 @@
#include "maze.h" #include "maze.h"
#include <assert.h> #include <assert.h>
int solve_maze(char* maze,int size){ int solve_maze(char* maze,int size) {
return 0; int i = 0;
while(i != size*size-1){
if (maze[i + 1] == ' ' && i != size - 1) {
maze[i + 1] = '*';
i++;
} else if (maze[i + size] == ' ' && i != size - 1) {
maze[i + size] = '*';
i = i + size;
} else if (maze[i - 1] == ' ' && i != 0) {
maze[i - 1] = '*';
i--;
} else if (maze[i - size] == ' ' && i > size) {
maze[i - size] = '*';
i = i - size;
}
}
return 1;
} }

Binary file not shown.

Binary file not shown.