prvy
This commit is contained in:
parent
29107acfc3
commit
7bcfc31c4c
BIN
sk1a/main.o
BIN
sk1a/main.o
Binary file not shown.
21
sk1a/maze.c
21
sk1a/maze.c
@ -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;
|
||||||
}
|
}
|
||||||
|
BIN
sk1a/maze.o
BIN
sk1a/maze.o
Binary file not shown.
BIN
sk1a/program
BIN
sk1a/program
Binary file not shown.
Loading…
Reference in New Issue
Block a user