From 509703392f2ea7737abe11e8366f625fdfdcebc2 Mon Sep 17 00:00:00 2001 From: Jannis Date: Fri, 10 Feb 2023 20:32:05 +0100 Subject: [PATCH] Funktion sucheXWert --- src/Spiellogik.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Spiellogik.c b/src/Spiellogik.c index 876185f..8e29906 100644 --- a/src/Spiellogik.c +++ b/src/Spiellogik.c @@ -10,6 +10,21 @@ int speed = 0; +int sucheXWert(int realU[N][N]){ + int groesste = 0; + int ii; + 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]; + ii = i; + + } + } + return i; + } +} + int win(int realU[N][N]){ int groesste = 0; for(int i = 0; i < N; i++){