From 0c24757f39a955279bde20f92a15c2ef8764140c Mon Sep 17 00:00:00 2001 From: Siamak Date: Fri, 10 Feb 2023 16:16:50 +0100 Subject: [PATCH] Richtung oben weiter --- src/Spiellogik.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Spiellogik.c b/src/Spiellogik.c index 11a1272..b470af6 100644 --- a/src/Spiellogik.c +++ b/src/Spiellogik.c @@ -119,6 +119,18 @@ int update(int realU[N][N],char richtung) { apple(realU); speed = speed + 20; } + else { + if (!lose(realU, richtung)) { + realU[ii + 1][jj] = 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) { + realU[i][j]--; + } + } + } + } + } } int probe(int input){