From 91609450a7cc8455cf2202142eeab3e2f049b05c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dami=C3=A1n=20Korpesio?= Date: Wed, 5 Jan 2022 12:30:37 +0100 Subject: [PATCH] prvy --- sk1a/maze.c | 12 ++++++++---- sk1a/maze.o | Bin 7080 -> 7056 bytes sk1a/program | Bin 21816 -> 21808 bytes 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sk1a/maze.c b/sk1a/maze.c index 7657e33..f3a3f0f 100644 --- a/sk1a/maze.c +++ b/sk1a/maze.c @@ -7,28 +7,32 @@ 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 (i % size - 1){l = 1;} + //else if (i < size*size - size){h = 1;} + //else if (i % size){p = 1;} + //else if (i >= size){d =1;} + if (maze[i + 1] == ' ' && l != 1) { maze[i + 1] = '*'; i++; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i + size] == ' ' /*&& i < size*size - size*/ && h != 1) { + } else if (maze[i + size] == ' ' && h != 1) { maze[i + size] = '*'; i = i + size; p = 0; l = 0; h = 0; d = 0; - } else if (maze[i - 1] == ' ' /*&& i % size*/ && p != 1) { + } else if (maze[i - 1] == ' ' && 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] == ' ' && d != 1) { maze[i - size] = '*'; i = i - size; p = 0; diff --git a/sk1a/maze.o b/sk1a/maze.o index b1611527575d2a28b2489034b7e99b3ecd68330b..86b78713cfc347cca57f536bbf151816aca2264b 100644 GIT binary patch delta 311 zcmXwyze~eF6vy*&z4WdmQD|v;i9&_qk0?bDiGp~IQVpo346XPZMe7arV%=}(^rSn4b55|&>6>7|kna6u&OF(XPmFQ)W^E2WMw3WZ9u7TLRR$&&MlV(c5H*3-07x-KunMNLN`7MH zvt{M?E-fu(mEO%Nv4&N69;@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