usaa21/sk1a/maze.c

33 lines
560 B
C
Raw Normal View History

2022-01-14 01:01:07 +00:00
#include <stdio.h>
#include <string.h>
#include "maze.h"
#include <assert.h>
#include <unistd.h>
#define CHECKED_BIT 16
#define DIRECTION_BITS 15
enum direction {
NORTH = 8,
EAST = 4,
SOUTH = 2,
WEST = 1,
NONE = 0
};
int solve_maze(char* maze, int size) {
if (maze[0] == 'x') {
return 0;
}
2022-01-14 01:26:39 +00:00
printf("\n");
2022-01-14 01:01:07 +00:00
for (int y = 0; y < size; y++) {
for (int x = 0; x < size; x++) {
2022-01-14 01:34:31 +00:00
printf("%c", maze[size * y + x]);
2022-01-14 01:01:07 +00:00
}
2022-01-14 01:26:39 +00:00
printf("\n");
2022-01-14 01:01:07 +00:00
}
2022-01-14 01:26:39 +00:00
printf("\nend %d\n\n", size);
2022-01-14 01:40:46 +00:00
return 0;
2022-01-14 01:01:07 +00:00
}