From ca838f238ae67d6043ee4a97dd53cc00049864b7 Mon Sep 17 00:00:00 2001 From: fdai7723 Date: Wed, 7 Feb 2024 19:35:46 +0000 Subject: [PATCH] =?UTF-8?q?Misc.c=20erstellt,=20Laufzeit-Features,=20Hendr?= =?UTF-8?q?ik=20Vo=C3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Misc.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/Misc.c b/src/Misc.c index 8b13789..2380bb5 100644 --- a/src/Misc.c +++ b/src/Misc.c @@ -1 +1,24 @@ +#include +#include +#include "Moving.h" +#include "Schachbrett.h" +#include "Spieler.h" +bool king_alive(char** brett) { + bool white_king_found = false; + bool black_king_found = false; + + for(int i = 0; i < 8; i++) { + for(int j = 0; j < 8; j++) { + if(brett[i][j] == 'K') { + white_king_found = true; + } else if(brett[i][j] == 'k') { + black_king_found = true; + } + } + } + + return white_king_found && black_king_found; +} + +// Während der Laufzeit des Spiels neue Features hinzufügen