From 7bcfc31c4c468051c9e4e39c1d8cd51d13f17f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Mon, 3 Jan 2022 15:54:09 +0100 Subject: [PATCH] prvy --- sk1a/main.o | Bin 7496 -> 7496 bytes sk1a/maze.c | 21 +++++++++++++++++++-- sk1a/maze.o | Bin 5736 -> 6168 bytes sk1a/program | Bin 21336 -> 21504 bytes 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/sk1a/main.o b/sk1a/main.o index 330aa67504c606bc6d38de8caf5e55bc294461ec..c7ee5e6006153994a325d6ef54c9f7e5f9936277 100644 GIT binary patch delta 93 zcmX?Mb;4=`6Dy;@WM)=HTS2ZOW(Ef4i4*Dt8GwLMf~y0_XPW3BRK&oj$e9WhW1iSk kFAS0d0gwO)2xT%bN=;5=m1C6N+`y{B%ox9UDaT?F01rJ7RR910 delta 93 zcmX?Mb;4=`6DuSCWM)=HTLG>jW(Ef4i4*Dt8GwLMoT~%KXPW3BRK&ojz?ljZW1iSk kFAS0d0gwO)2xT%bN={B>m1C6J+`y{B%ow+MDaT?F01g5WP5=M^ diff --git a/sk1a/maze.c b/sk1a/maze.c index 5f09bc8..d078bb5 100644 --- a/sk1a/maze.c +++ b/sk1a/maze.c @@ -3,6 +3,23 @@ #include "maze.h" #include -int solve_maze(char* maze,int size){ - return 0; +int solve_maze(char* maze,int size) { + 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; } diff --git a/sk1a/maze.o b/sk1a/maze.o index e73ecc2c73b7bd01d98639571b124a957b9f3a53..c8ded7d6b8be0c4d081989d6fd0006f97bb1a1b0 100644 GIT binary patch delta 788 zcmZ9I&ubGw6vuaF^P0}GHr*dhH<;1{wzN%+sZcy9TBu+VTLdc#38-KL z1`8!Bi38Gu_!kt51d2zk;IC7_YY!eGq!d9scv^@vJ1v^L!#>{k`#$f@+xD@ITx|k7 zRy~t0x7SOpPc%???EU1QDh>P%|LFzfS83Zv&Dgdwohpr2X{*vkr)f}3_I7+!G8G!2 zy)8js3V0`K`q!IX{KP+gq^qYKF5x2tMuYv^htoS<{AlH2pcE6mrdYiap#4+an4+!T zt!XZwp{-THb=h*?Bn_$w+KO$xlc&WVqfV#u7V$f-eweIZPT@3qbN?IWiOs3;kt+sw z6x26*gC|_SXx>y%l*r;1E2`hYJfW!l%#Vx-zRq?`k35S=@fS-IizO|Wtb$Z> zp|W7PSTWfn%OkH3j2G;SmB%@gVcWy!qO4$hq@YP?DuiCzE?&{Z9}eHL%gZ|&!$Tgf iX{^AL&nNQqSz|jx9?9tvw&WY)F1cn(Wjj=M4gD{+s@Zb@ delta 409 zcmbPX@Iq&T22+OML@h|q&Z1_l-olYxT~MDl^%**D>!_EQJA-(wlmj@#g&{i!TKX#xY7rBHd_Xw*nhJlQm z{D6yP@);B!kBACq7{p`-g~^s8=1eoVCKrj=ah3sn1_JlNMw|gE3x#-;!2m46BdWp_ zATZfT)Q+zIU{sg3E08JFPW0K&UTqJJC*}w(SEDUjjxC-Y60f@*put<+E4*<_0REq!r diff --git a/sk1a/program b/sk1a/program index 6045c16f7d18d58277e24cce9bc1f8ef9761ebe4..1c484b5fd9ddd45b5b9ba2a36939ba6cf6052b75 100644 GIT binary patch delta 1213 zcmZ9Ke`s4(6vywqFE>rnwCQ^<-O{d0@|4-MGo?({G;Omr*w>|X3>VvKM^TH|;+R8A z`p?+RApTg$s!6ZN(9(Z4L`I>T58M>gvY~EcYET*CFGQkb-GtgW!R>|Txp^DXUU>Js zbH3+u&O7(M@888o-^1AeL678Ge{pQ5sIsai2CnMZLfqZVU0@A?4s z_@|pQY9Up`VO38wtih2k%uk z*6_a65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