From b1a4ef03aa4c3db33522335cbec7f473c116ae44 Mon Sep 17 00:00:00 2001 From: Siamak Date: Fri, 10 Feb 2023 18:43:19 +0100 Subject: [PATCH] Funktionsupdate --- src/Spiellogik.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Spiellogik.c b/src/Spiellogik.c index 4f41931..72038d5 100644 --- a/src/Spiellogik.c +++ b/src/Spiellogik.c @@ -138,14 +138,14 @@ int update(int realU[N][N],char richtung) { if (jj == 0) { return 1; } - if (realbU[ii][jj - 1] == (N * N) + 1) { - realb[ii][jj - 1] = groesste + 1; + if (realU[ii][jj - 1] == (N * N) + 1) { + realU[ii][jj - 1] = groesste + 1; apple(realU); speed = speed + 20; } else { if (!lose(realU, richtung)) { - realU[ii][jj - 1] = max + 1; + realU[ii][jj - 1] = groesste + 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) { @@ -164,7 +164,7 @@ int update(int realU[N][N],char richtung) { return 1; } if (realU[ii][jj + 1] == (N * N) + 1) { - realb[ii][jj + 1] = groesste + 1; + realU[ii][jj + 1] = groesste + 1; apple(realU); speed = speed + 20; }