From 4af2fc73e41c36ad408ee82cd3b4da27fd753fbb Mon Sep 17 00:00:00 2001 From: Jannis Date: Fri, 10 Feb 2023 20:52:21 +0100 Subject: [PATCH] Refactoring update --- src/Spiellogik.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/Spiellogik.c b/src/Spiellogik.c index 9fcb6fa..06fad39 100644 --- a/src/Spiellogik.c +++ b/src/Spiellogik.c @@ -88,17 +88,10 @@ int lose(int realU[N][N], char richtung){ } int update(int realU[N][N],char richtung) { - int groesste = 0; - int ii, jj; - for(int i = 0; i < N; i++) { - for(int j = 0; j < N; j++) { - if(realU[N][N] > groesste && realU[N][N] != (N * N) + 1) { - groesste = realU[i][j]; - ii = i; - jj = j; - } - } - } + + int ii = sucheXWert(realU); + int jj = sucheYWert(realU); + if(richtung == 'u') { if(ii == 0) { return 1;