From f48587107cee612b703112699f3af86dab105747 Mon Sep 17 00:00:00 2001 From: Siamak Date: Fri, 10 Feb 2023 16:59:58 +0100 Subject: [PATCH] Linksfunktion zuende --- src/Spiellogik.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Spiellogik.c b/src/Spiellogik.c index 3e713ca..609281a 100644 --- a/src/Spiellogik.c +++ b/src/Spiellogik.c @@ -147,14 +147,17 @@ int update(int realU[N][N],char richtung) { else { if (!lose(realU, richtung)) { realU[ii][jj - 1] = max + 1; - } - for (int i = 0; i < N; i++) { - for (int j = 0; j < N; j++) { - if (realU[i][j] != 0 && realU[i][j] != (N * N) + 1) { - realU[i][j]--; + for (int i = 0; i < N; i++) { + for (int j = 0; j < N; j++) { + if (realU[i][j] != 0 && realU[i][j] != (N * N) + 1) { + realU[i][j]--; + } } } - } + } + else { + return 1; + } } }