From 68d4f32f7760aa88edb67de7f3958427a4366d07 Mon Sep 17 00:00:00 2001 From: Jannis Date: Fri, 10 Feb 2023 20:34:05 +0100 Subject: [PATCH] Funktion sucheYWert --- src/Spiellogik.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Spiellogik.c b/src/Spiellogik.c index 8e29906..85c2151 100644 --- a/src/Spiellogik.c +++ b/src/Spiellogik.c @@ -21,8 +21,23 @@ int sucheXWert(int realU[N][N]){ } } - return i; } + return ii; +} + +int sucheYWert(int realU[N][N]){ + int groesste = 0; + int jj; + for(int i = 0; i < N ; i++){ + for(int j = 0; j < N; j++){ + if (realU[i][j] > groesste && realU[i][j] != (N * N) + 1){ + groesste = realU[i][j]; + jj = j; + + } + } + } + return jj; } int win(int realU[N][N]){