From a7f628872d8d3f134558aaf75619e94adcb76000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Thu, 20 Jan 2022 07:46:16 +0000 Subject: [PATCH] Delete 'sk1a/readme.md' --- sk1a/readme.md | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 sk1a/readme.md diff --git a/sk1a/readme.md b/sk1a/readme.md deleted file mode 100644 index db621f2..0000000 --- a/sk1a/readme.md +++ /dev/null @@ -1,42 +0,0 @@ -#include -#include -#include "maze.h" -#include - -int issafe(char* maze, int x, int y, int size) { -if ((x >= 0 && x < size) && (y >= 0 && y < size) && (maze[x * size + y] == ' ')){ -return 1; -} -return 0; -} - -int backtracking(char* maze, int x, int y, int size){ //https://www.geeksforgeeks.org/rat-in-a-maze-backtracking-2/ -if(x == size - 1 && y == size - 1 && maze[x * size + y] == ' '){ //kontrola ci sa nachadzam na konci -maze[x * size + y] = '*'; -return 1; -} - - if(issafe(maze, x, y, size) == 1) { // znazornenie stien - maze[x * size + y] = '*'; - - if (backtracking(maze, x, y + 1, size) == 1) { //pohyb doprava - return 1; - } - if (backtracking(maze, x + 1, y, size) == 1) { //pohyb dole - return 1; - } - if (backtracking(maze, x - 1, y, size) == 1) { //pohyb dol - - return 1; - } - if (backtracking(maze, x, y - 1, size) == 1) { //pohyb hore - return 1; - } - maze[x * size + y] = ' '; - } - return 0; -} - -int solve_maze(char* maze, int size) { -return backtracking(maze, 0, 0, size); //volanie funkcie -} \ No newline at end of file