From e649038429638d58be63659e108c6cfa2531b93d Mon Sep 17 00:00:00 2001 From: vj586da Date: Fri, 21 Jan 2022 22:13:58 +0100 Subject: [PATCH] right movement --- sk1a/maze.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/sk1a/maze.c b/sk1a/maze.c index 1401ef5..fdf2dfc 100644 --- a/sk1a/maze.c +++ b/sk1a/maze.c @@ -14,9 +14,11 @@ int solve_maze(char* maze,int size){ while(actualPos != size*size-1){ //printf("acpos: %d\n", actualPos); + + //Pohyb dole if(actualPos < (size*size-size) && maze[actualPos+size]==' '){ - //printf("dole\n"); + printf("dole\n"); maze[actualPos+size]='*'; actualPos+=size; //printf("acpos: %d\n", actualPos); @@ -25,27 +27,27 @@ int solve_maze(char* maze,int size){ //Pohyb vpravo if(maze[actualPos+1]==' '){ - //puts("vpravo"); - maze[actualPos]='*'; + puts("vpravo"); + maze[actualPos+1]='*'; actualPos++; continue; } //Pohyb hore - /* if(maze[actualPos-size]==' ' && actualPos-size != 0){ + if(maze[actualPos-size]==' ' && actualPos-size != 0){ maze[actualPos-size]='*'; actualPos-=size; continue; - }*/ + } + -/* //Pohyb vlavo if(maze[actualPos-1]==' '){ maze[actualPos]='*'; actualPos--; continue; } -*/ +