From eb8de40367edf28be23f1422c46dcb530f042e58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Tue, 4 Jan 2022 20:39:32 +0100 Subject: [PATCH] prvy --- sk1a/main.c | 11 ++++++----- sk1a/main.o | Bin 7496 -> 7472 bytes sk1a/maze.c | 16 ++++++++-------- sk1a/maze.o | Bin 7168 -> 7080 bytes sk1a/program | Bin 21856 -> 21816 bytes 5 files changed, 14 insertions(+), 13 deletions(-) diff --git a/sk1a/main.c b/sk1a/main.c index 95139d5..ef56060 100644 --- a/sk1a/main.c +++ b/sk1a/main.c @@ -15,11 +15,12 @@ void print_solution(char* matrix,int sz){ int main(){ char tmaze[SZ+1][SZ+1]={ - "*x ", - " xx ", - " x ", - " x ", - " ", + "*x ", + " xx ", + " x ", + " x ", + " ", + " ", }; char maze[SZ*SZ]; memset(maze,' ',SZ*SZ); diff --git a/sk1a/main.o b/sk1a/main.o index f4a04da47028ca2258417e4ab71bd822e31d3527..60843e1abc1d62cc68e1d3c0aa0d98a96cb02c2f 100644 GIT binary patch delta 543 zcmYk1!Al!K6vpSxx@Om|nwXmGZkBdTV@VVbMTjDjDM-MRvg`F5g@E9yCgeW2+ z7SRI1 z%Zlr6twqK0ybw!u_e9X%smSM*I9K9A2$3gIQsRo%%DGmeOpX#&!7{t%b1NtE9h6vDnQO(j|_pWsdI!NRX^3&cMBVM z*%h;Q+Ab$Yqx!=hzL0zLZ?=o9zuAi4)BUVDdfT3-`zt7^f_lL>q9G17?6Ia`8MBte zwZs4(S`)wgWKD3!(XdnW(yT2ZjRjkBBZPOfB~f=IY-84u`bt>kGPaMNGX-UAI+6!< vG~y}VXW|@D%2dCD#dwlZnsEt>s3#=cW0rau3)DZcnUFe*wW4m(vxa^E2>pxp diff --git a/sk1a/maze.c b/sk1a/maze.c index 98825c2..7657e33 100644 --- a/sk1a/maze.c +++ b/sk1a/maze.c @@ -7,28 +7,28 @@ int solve_maze(char* maze,int size) { int i = 0; int p, l, h, d = 0; while(i != size*size-1){ - if (maze[i + 1] == ' ' && i != size - 1 && l != 1) { + if (maze[i + 1] == ' ' && i % size - 1 && l != 1) { maze[i + 1] = '*'; i++; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i + size] == ' ' && i != size - 1 && h != 1) { + } else if (maze[i + size] == ' ' /*&& i < size*size - size*/ && h != 1) { maze[i + size] = '*'; i = i + size; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i - 1] == ' ' && i != 0 && p != 1) { + } else if (maze[i - 1] == ' ' /*&& i % size*/ && p != 1) { maze[i - 1] = '*'; i--; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i - size] == ' ' && i > size && d != 1) { + } else if (maze[i - size] == ' ' /*&& i >= size*/ && d != 1) { maze[i - size] = '*'; i = i - size; p = 0; @@ -40,19 +40,19 @@ int solve_maze(char* maze,int size) { while(1){ if (maze[i + 1] == ' ' && i != size - 1 && l != 1) { - i++; + //i++; break; } if (maze[i + size] == ' ' && i != size - 1 && h != 1) { - i = i + size; + //i = i + size; break; } if (maze[i - 1] == ' ' && i != 0 && p != 1) { - i--; + //i--; break; } if (maze[i - size] == ' ' && i > size && d != 1) { - i = i - size; + //i = i - size; break; } p = 0; diff --git a/sk1a/maze.o b/sk1a/maze.o index d13f7c74de8d99ad916ac41fd46ed5bc7aa29d1a..b1611527575d2a28b2489034b7e99b3ecd68330b 100644 GIT binary patch delta 603 zcmZ{gPiPZS5XN_A^U@@mY(h54zD=@U~?7^%A5$&-Jf)>H{Br1tHrIZE> z5|k`+F%>LDgdPO{1log_c=u2w(nRnmDCCfX&>qD2Hj4)jzQg;5?>BsJ=B>_bryB-t z$L-V8khO2{;FY@7Zyr=TkM?SZV6SDdhZI5G{$}bcC`p1Ao)#X@4GVRvTYx=fN6Mzk zl!pwQqE+Cu1+(}G?33m>fI=0Msk*T81a6`@s!P`vu<3+|BOnuHKUE<{6njkGZ z@Ij{eP(E6bB}uYE;dQ(i^vZYSqhmgT1gAF%PwQh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