From 128bfa21d26b2a424935637176d2be39bac6d918 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:19:55 +0100 Subject: [PATCH 01/56] Importiere wichtige Bibliotheken --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/main/c/VierGewinnt.c diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c new file mode 100644 index 0000000..cf058e3 --- /dev/null +++ b/src/main/c/VierGewinnt.c @@ -0,0 +1,3 @@ +//Importiere wichtige Bibliotheken +#include +#include From 0f92499ece4dfe239b70bface7b5477d33b8f222 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:20:41 +0100 Subject: [PATCH 02/56] =?UTF-8?q?Definiere=20Feldgr=C3=B6=C3=9Fe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index cf058e3..661ea87 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -1,3 +1,7 @@ //Importiere wichtige Bibliotheken #include #include + +//Definiere Feldgröße +#define ROWS 6 +#define COLS 7 From bf61a009911977c0148c6ec6d50b14de3011355e Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:21:21 +0100 Subject: [PATCH 03/56] Definiere Farben --- src/main/c/VierGewinnt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 661ea87..5d0a497 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -5,3 +5,14 @@ //Definiere Feldgröße #define ROWS 6 #define COLS 7 + +// Definiere Farben +#define RESET_COLOR "\033[0m" +#define BLACK "\033[0;30m" +#define RED "\033[0;31m" +#define GREEN "\033[0;32m" +#define YELLOW "\033[0;33m" +#define BLUE "\033[0;34m" +#define MAGENTA "\033[0;35m" +#define CYAN "\033[0;36m" +#define WHITE "\033[0;37m" From 107475af8f4a011a6093d1d55cbbac77ab42f1d9 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:22:18 +0100 Subject: [PATCH 04/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20initialize?= =?UTF-8?q?Board?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 5d0a497..d07efff 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -16,3 +16,7 @@ #define MAGENTA "\033[0;35m" #define CYAN "\033[0;36m" #define WHITE "\033[0;37m" + + +//Funktionsprototyp für initializeBoard +void initializeBoard(char board[ROWS][COLS]); From 7fe15fcedca072ba8e556e196c8351fc3d023198 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:23:13 +0100 Subject: [PATCH 05/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20printBoard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index d07efff..5a6ddb2 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -20,3 +20,6 @@ //Funktionsprototyp für initializeBoard void initializeBoard(char board[ROWS][COLS]); + +//Funktionsprototyp für printBoard +void printBoard(char board[ROWS][COLS]); From 99373604d53b7ee0b9ada1fad7fb325c05120ee8 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:24:00 +0100 Subject: [PATCH 06/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20clearScree?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 5a6ddb2..e4a5031 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -23,3 +23,6 @@ void initializeBoard(char board[ROWS][COLS]); //Funktionsprototyp für printBoard void printBoard(char board[ROWS][COLS]); + +// Funktionsprototyp für clearScreen +void clearScreen(); From f166bb60ff691bf47508fd569f667c07707c78ee Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:24:55 +0100 Subject: [PATCH 07/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20isColumnFu?= =?UTF-8?q?ll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index e4a5031..bc8d922 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -26,3 +26,6 @@ void printBoard(char board[ROWS][COLS]); // Funktionsprototyp für clearScreen void clearScreen(); + +//Funktionsprototyp für isColumnFull +int isColumnFull(char board[ROWS][COLS], int col); From 4898e38878c5b0ab2aa8a6e0a3b150a48a2903bf Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:25:38 +0100 Subject: [PATCH 08/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20dropPiece?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index bc8d922..edcbe34 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -29,3 +29,7 @@ void clearScreen(); //Funktionsprototyp für isColumnFull int isColumnFull(char board[ROWS][COLS], int col); + +//Funktionsprototyp für dropPiece +int dropPiece(char board[ROWS][COLS], int col, char player); + From 399950a81b1e3632825e3bc19b761dcc349f0fd4 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:26:24 +0100 Subject: [PATCH 09/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20checkWin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index edcbe34..7139b27 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -32,4 +32,6 @@ int isColumnFull(char board[ROWS][COLS], int col); //Funktionsprototyp für dropPiece int dropPiece(char board[ROWS][COLS], int col, char player); +//Funktionsprototyp für checkWin +int checkWin(char board[ROWS][COLS], char player); From 8cd86a70242fde344826d673093bd2757905737a Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:27:10 +0100 Subject: [PATCH 10/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20checkHoriz?= =?UTF-8?q?ontal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 7139b27..3e60a29 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -34,4 +34,6 @@ int isColumnFull(char board[ROWS][COLS], int col); int dropPiece(char board[ROWS][COLS], int col, char player); //Funktionsprototyp für checkWin int checkWin(char board[ROWS][COLS], char player); +// Funktionsprototyp für checkHorizontal +int checkHorizontal(char board[ROWS][COLS], char player); From 9f9046af94507448f70496949d08a7670c128296 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:27:57 +0100 Subject: [PATCH 11/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20checkVerti?= =?UTF-8?q?cal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 3e60a29..dcb003d 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -37,3 +37,6 @@ int checkWin(char board[ROWS][COLS], char player); // Funktionsprototyp für checkHorizontal int checkHorizontal(char board[ROWS][COLS], char player); +// Funktionsprototyp für checkVertical +int checkVertical(char board[ROWS][COLS], char player); + From f3f300a91694b7abd02ff62442ab8a0248d1b312 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:29:00 +0100 Subject: [PATCH 12/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20checkDiago?= =?UTF-8?q?nalLR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index dcb003d..939c436 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -40,3 +40,6 @@ int checkHorizontal(char board[ROWS][COLS], char player); // Funktionsprototyp für checkVertical int checkVertical(char board[ROWS][COLS], char player); +// Funktionsprototyp für checkDiagonalLR +int checkDiagonalLR(char board[ROWS][COLS], char player); + From 1b3477fd2da316cfc538f874be2f5c90ef0d1709 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:30:22 +0100 Subject: [PATCH 13/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20checkDiago?= =?UTF-8?q?nalRL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 939c436..77795f7 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -43,3 +43,6 @@ int checkVertical(char board[ROWS][COLS], char player); // Funktionsprototyp für checkDiagonalLR int checkDiagonalLR(char board[ROWS][COLS], char player); +// Funktionsprototyp für checkDiagonalRL +int checkDiagonalRL(char board[ROWS][COLS], char player); + From 1e33053766e4e1d671672b625dde2147b9d0e979 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:31:02 +0100 Subject: [PATCH 14/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20showMessag?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 77795f7..4fdd8c3 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -46,3 +46,6 @@ int checkDiagonalLR(char board[ROWS][COLS], char player); // Funktionsprototyp für checkDiagonalRL int checkDiagonalRL(char board[ROWS][COLS], char player); +// Funktionsprototyp für showMessage +void showMessage(const char* messageColor, const char* message); + From 20b97fe1eaf62fc9c3a2c06d31a34b0e741a1f75 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:31:44 +0100 Subject: [PATCH 15/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20showInvali?= =?UTF-8?q?dInputMessage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 4fdd8c3..2a68a6e 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -48,4 +48,5 @@ int checkDiagonalRL(char board[ROWS][COLS], char player); // Funktionsprototyp für showMessage void showMessage(const char* messageColor, const char* message); - +//Funktionsprototyp für showInvalidInputMessage +void showInvalidInputMessage(); From 04ca12eff98fcff5aeae8a1616c259dbc71c7ed3 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:32:48 +0100 Subject: [PATCH 16/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20showColumn?= =?UTF-8?q?FullMessage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 2a68a6e..f77c5da 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -50,3 +50,6 @@ int checkDiagonalRL(char board[ROWS][COLS], char player); void showMessage(const char* messageColor, const char* message); //Funktionsprototyp für showInvalidInputMessage void showInvalidInputMessage(); + +//Funktionsprototyp für showColumnFullMessage +void showColumnFullMessage(); From fd012eff4f61d664856afb9cd3e983085915d300 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:33:37 +0100 Subject: [PATCH 17/56] =?UTF-8?q?Funktionsprototyp=20f=C3=BCr=20showWinMes?= =?UTF-8?q?sage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index f77c5da..b1b9d51 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -53,3 +53,6 @@ void showInvalidInputMessage(); //Funktionsprototyp für showColumnFullMessage void showColumnFullMessage(); + +//Funktionsprototyp für showWinMessage +void showWinMessage(int player); From 1b57cd1dba5593247014c405ff77c7385a4cb26f Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:34:40 +0100 Subject: [PATCH 18/56] Write starter function --- src/main/c/VierGewinnt.c | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index b1b9d51..9108a58 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -56,3 +56,44 @@ void showColumnFullMessage(); //Funktionsprototyp für showWinMessage void showWinMessage(int player); + + +//Write starter function +int main_function() { + char board[ROWS][COLS]; + int currentPlayer = 1; // Spieler 1 beginnt + + initializeBoard(board); + printBoard(board); + + int column; + while (1) { + printf(YELLOW"Spieler %d, wähle eine Spalte (1-7): "RESET_COLOR, currentPlayer); + + scanf("%d", &column); + if (column < 1 || column > 7) { + showInvalidInputMessage(); + continue; + } + + column--; + + if (isColumnFull(board, column)) { + showColumnFullMessage(); + continue; + } + + if (dropPiece(board, column, (currentPlayer == 1) ? 'X' : 'O')) { + printBoard(board); + if (checkWin(board, (currentPlayer == 1) ? 'X' : 'O')) { + showWinMessage(currentPlayer); + break; + } + + currentPlayer = (currentPlayer == 1) ? 2 : 1; + } + } + + return 0; +} + From e5a065d12a668302ed7c0b3c214d8b77637e1cb5 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:35:23 +0100 Subject: [PATCH 19/56] Write initializeBoard function --- src/main/c/VierGewinnt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 9108a58..0b7b0c1 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -96,4 +96,11 @@ int main_function() { return 0; } - +// Write initializeBoard function +void initializeBoard(char board[ROWS][COLS]) { + for (int i = 0; i < ROWS; i++) { + for (int j = 0; j < COLS; j++) { + board[i][j] = ' '; + } + } +} From 177bf0211d8eb297697dbfb6c3b3fa79bf90b905 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:36:25 +0100 Subject: [PATCH 20/56] Write printBoard function --- src/main/c/VierGewinnt.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 0b7b0c1..7fde45c 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -104,3 +104,25 @@ void initializeBoard(char board[ROWS][COLS]) { } } } + + +// Write printBoard function +void printBoard(char board[ROWS][COLS]) { + clearScreen(); + printf("\n"); + + for (int i = 0; i < ROWS; i++) { + for (int j = 0; j < COLS; j++) { + printf("| %c ", board[i][j]); + } + printf("|\n"); + + for (int j = 0; j < COLS; j++) { + printf("----"); + } + printf("-\n"); + } + + printf(" 1 2 3 4 5 6 7\n\n"); +} + From e5e445ec0faa798ee505f7bcf35986a3b5f4785f Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:37:13 +0100 Subject: [PATCH 21/56] Write clearScreen function --- src/main/c/VierGewinnt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 7fde45c..043054e 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -125,4 +125,11 @@ void printBoard(char board[ROWS][COLS]) { printf(" 1 2 3 4 5 6 7\n\n"); } - +// Write clearScreen function +void clearScreen() { +#ifdef _WIN32 + system("cls"); +#else + system("clear"); +#endif +} From 7640258c05046740d35146998eeed2a8e3a883d7 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:37:48 +0100 Subject: [PATCH 22/56] Write isColumnFull function --- src/main/c/VierGewinnt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 043054e..000a60e 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -133,3 +133,8 @@ void clearScreen() { system("clear"); #endif } + +// Write isColumnFull function +int isColumnFull(char board[ROWS][COLS], int col) { + return (board[0][col] != ' '); +} From d796abbae3c3c296f25aaebe3d027a76fa341241 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:38:30 +0100 Subject: [PATCH 23/56] Write dropPiece function --- src/main/c/VierGewinnt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 000a60e..5959d98 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -138,3 +138,15 @@ void clearScreen() { int isColumnFull(char board[ROWS][COLS], int col) { return (board[0][col] != ' '); } + +//Write dropPiece function +int dropPiece(char board[ROWS][COLS], int col, char player) { + for (int i = ROWS - 1; i >= 0; i--) { + if (board[i][col] == ' ') { + board[i][col] = player; + return 1; + } + } + + return 0; // Column is full +} From 1e1e37b79180d2a17a6759aa9d6b2daae9542e04 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:39:09 +0100 Subject: [PATCH 24/56] Write checkHorizontal function --- src/main/c/VierGewinnt.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 5959d98..2ae4fc6 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -150,3 +150,19 @@ int dropPiece(char board[ROWS][COLS], int col, char player) { return 0; // Column is full } + + +// Write checkHorizontal function +int checkHorizontal(char board[ROWS][COLS], char player) { + for (int row = 0; row < ROWS; row++) { + for (int col = 0; col <= COLS - 4; col++) { + if (board[row][col] == player && + board[row][col + 1] == player && + board[row][col + 2] == player && + board[row][col + 3] == player) { + return 1; // Gewonnen + } + } + } + return 0; +} From 46f3cb93c69cfc7630e1ce3d8ce7fdf998a3af96 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:39:53 +0100 Subject: [PATCH 25/56] Write checkVertical function --- src/main/c/VierGewinnt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 2ae4fc6..9bcbac0 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -166,3 +166,18 @@ int checkHorizontal(char board[ROWS][COLS], char player) { } return 0; } + +//Write checkVertical function +int checkVertical(char board[ROWS][COLS], char player) { + for (int col = 0; col < COLS; col++) { + for (int row = 0; row <= ROWS - 4; row++) { + if (board[row][col] == player && + board[row + 1][col] == player && + board[row + 2][col] == player && + board[row + 3][col] == player) { + return 1; // Gewonnen + } + } + } + return 0; +} From 234b2bf10390c9fe6477f39d423d9ec6f514d46e Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:40:29 +0100 Subject: [PATCH 26/56] Write checkDiagonalLR function --- src/main/c/VierGewinnt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 9bcbac0..fd18639 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -181,3 +181,27 @@ int checkVertical(char board[ROWS][COLS], char player) { } return 0; } + + + +// Write checkDiagonalLR function +int checkDiagonalLR(char board[ROWS][COLS], char player) { + for (int row = 0; row <= ROWS - 4; row++) { + for (int col = 0; col <= COLS - 4; col++) { + if (board[row][col] == player && + board[row + 1][col + 1] == player && + board[row + 2][col + 2] == player && + board[row + 3][col + 3] == player) { + return 1; // Gewonnen + } + } + } + return 0; +} + + + + + + + From 79e09720038332773849c206aafa833cc0e33bd7 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:41:14 +0100 Subject: [PATCH 27/56] Write checkDiagonalRL function --- src/main/c/VierGewinnt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index fd18639..d54a6bf 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -202,6 +202,21 @@ int checkDiagonalLR(char board[ROWS][COLS], char player) { +// Write checkDiagonalRL function +int checkDiagonalRL(char board[ROWS][COLS], char player) { + for (int row = 0; row <= ROWS - 4; row++) { + for (int col = 3; col < COLS; col++) { + if (board[row][col] == player && + board[row + 1][col - 1] == player && + board[row + 2][col - 2] == player && + board[row + 3][col - 3] == player) { + return 1; // Gewonnen + } + } + } + return 0; +} + From 095a9188c2b00c5e2ee91467825ce66a1e5ed21c Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:41:49 +0100 Subject: [PATCH 28/56] Write checkWin function --- src/main/c/VierGewinnt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index d54a6bf..13b8674 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -215,6 +215,15 @@ int checkDiagonalRL(char board[ROWS][COLS], char player) { } } return 0; + +} + +// Write checkWin function +int checkWin(char board[ROWS][COLS], char player) { + return checkHorizontal(board, player) || + checkVertical(board, player) || + checkDiagonalLR(board, player) || + checkDiagonalRL(board, player); } From 20a83ac492fcc3713cc32cab71db4a3ef29059ea Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:42:23 +0100 Subject: [PATCH 29/56] Write showMessage function --- src/main/c/VierGewinnt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 13b8674..a1e92e3 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -227,5 +227,8 @@ int checkWin(char board[ROWS][COLS], char player) { } - +// Write showMessage function +void showMessage(const char* messageColor, const char* message) { + printf("%s%s"RESET_COLOR, messageColor, message); +} From 949cce4dc8ca1f0807bbd3d97af74c147ca815ec Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:43:04 +0100 Subject: [PATCH 30/56] Write showInvalidInputMessage function --- src/main/c/VierGewinnt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index a1e92e3..d9261e8 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -232,3 +232,7 @@ void showMessage(const char* messageColor, const char* message) { printf("%s%s"RESET_COLOR, messageColor, message); } +// Write showInvalidInputMessage function +void showInvalidInputMessage() { + showMessage(RED, "Ungültige Eingabe. Bitte wähle eine Spalte zwischen 1 und 7.\n"); +} From b3e4f6284788eb82c518a1d69708c9dce06c4d3b Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:43:42 +0100 Subject: [PATCH 31/56] Write showColumnFullMessage function --- src/main/c/VierGewinnt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index d9261e8..37d49cc 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -236,3 +236,14 @@ void showMessage(const char* messageColor, const char* message) { void showInvalidInputMessage() { showMessage(RED, "Ungültige Eingabe. Bitte wähle eine Spalte zwischen 1 und 7.\n"); } + + + + +// Write showColumnFullMessage function +void showColumnFullMessage() { + showMessage(RED, "Die Spalte ist voll. Bitte wähle eine andere.\n"); +} + + + From 8cf7073811eabff1b121d9b5e4dc0ca455fa2237 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:44:31 +0100 Subject: [PATCH 32/56] Write showWinMessage function} --- src/main/c/VierGewinnt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 37d49cc..c4d1419 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -247,3 +247,10 @@ void showColumnFullMessage() { +// Write showWinMessage function +void showWinMessage(int player) { + printf("Spieler %d hat gewonnen!\n", player); +} + + + From d7ea58f33a9145995d6b7e63e418759a63029313 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:46:40 +0100 Subject: [PATCH 33/56] add constants --- src/main/c/VierGewinnt.h | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/main/c/VierGewinnt.h diff --git a/src/main/c/VierGewinnt.h b/src/main/c/VierGewinnt.h new file mode 100644 index 0000000..6ec2043 --- /dev/null +++ b/src/main/c/VierGewinnt.h @@ -0,0 +1,5 @@ +#ifndef VIERGEWINNT_H +#define VIERGEWINNT_H + +#define ROWS 6 +#define COLS 7 From 4b61913ed74468c25733390daf6f5b2dc4a15542 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:47:16 +0100 Subject: [PATCH 34/56] define function --- src/main/c/VierGewinnt.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/c/VierGewinnt.h b/src/main/c/VierGewinnt.h index 6ec2043..a52d6cd 100644 --- a/src/main/c/VierGewinnt.h +++ b/src/main/c/VierGewinnt.h @@ -3,3 +3,17 @@ #define ROWS 6 #define COLS 7 + +void initializeBoard(char board[ROWS][COLS]); +void printBoard(char board[ROWS][COLS]); +int isColumnFull(char board[ROWS][COLS], int col); +int dropPiece(char board[ROWS][COLS], int col, char player); +int checkWin(char board[ROWS][COLS], char player); +int checkHorizontal(char board[ROWS][COLS], char player); +int checkVertical(char board[ROWS][COLS], char player); +int checkDiagonalLR(char board[ROWS][COLS], char player); +int checkDiagonalRL(char board[ROWS][COLS], char player); +void showMessage(const char* messageColor, const char* message); +void showInvalidInputMessage(); +void showColumnFullMessage(); +void showWinMessage(int player); From 7dd63bde307f30f32a705194115fcd611bb1c517 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:47:52 +0100 Subject: [PATCH 35/56] define function --- src/main/c/VierGewinnt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/c/VierGewinnt.h b/src/main/c/VierGewinnt.h index a52d6cd..689034c 100644 --- a/src/main/c/VierGewinnt.h +++ b/src/main/c/VierGewinnt.h @@ -17,3 +17,4 @@ void showMessage(const char* messageColor, const char* message); void showInvalidInputMessage(); void showColumnFullMessage(); void showWinMessage(int player); +#endif From 7292f053a2be6851c30652da4819c29655afdba5 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:55:52 +0100 Subject: [PATCH 36/56] test_dropPiece_ValidMove --- src/test/c/test_VierGewinnt.c | 17 +++++++++++++++++ src/test/c/test_test.c | 28 ---------------------------- 2 files changed, 17 insertions(+), 28 deletions(-) create mode 100644 src/test/c/test_VierGewinnt.c delete mode 100644 src/test/c/test_test.c diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c new file mode 100644 index 0000000..4690b45 --- /dev/null +++ b/src/test/c/test_VierGewinnt.c @@ -0,0 +1,17 @@ +#include "unity.h" +#include "VierGewinnt.h" + +void setUp(void) { +} + +void tearDown(void) { +} + + +void test_dropPiece_ValidMove(void) { + char board[6][7]; + initializeBoard(board); + + TEST_ASSERT_EQUAL_INT(1, dropPiece(board, 3, 'X')); +} + diff --git a/src/test/c/test_test.c b/src/test/c/test_test.c deleted file mode 100644 index 4f61ea7..0000000 --- a/src/test/c/test_test.c +++ /dev/null @@ -1,28 +0,0 @@ -#ifdef TEST - -#include "unity.h" - -#include "test.h" - -void setUp(void) -{ -} - -void tearDown(void) -{ -} - -void test_test__return_5(void) -{ - /* arrange */ - int expected = 5; - int actual; - - /* act */ - actual = return_5(); - - /* assert */ - TEST_ASSERT_EQUAL_INT(expected, actual); -} - -#endif // TEST From 2824ad7a74355cb1b245558ab4d2691b3a2a2fc7 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:57:30 +0100 Subject: [PATCH 37/56] test_dropPiece_FullColum --- src/test/c/test_VierGewinnt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 4690b45..91bfaff 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -15,3 +15,16 @@ void test_dropPiece_ValidMove(void) { TEST_ASSERT_EQUAL_INT(1, dropPiece(board, 3, 'X')); } + +void test_dropPiece_FullColumn(void) { + char board[6][7] = { + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'} + }; + + TEST_ASSERT_EQUAL_INT(0, dropPiece(board, 3, 'X')); // Spalte ist voll, sollte 0 zurückgeben +} From 0b85b5496c1c8ad4f189b39e27223e6d253fb0a3 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 00:59:00 +0100 Subject: [PATCH 38/56] test_checkWin_Horizontal_X --- src/test/c/test_VierGewinnt.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 91bfaff..8ad593b 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -28,3 +28,38 @@ void test_dropPiece_FullColumn(void) { TEST_ASSERT_EQUAL_INT(0, dropPiece(board, 3, 'X')); // Spalte ist voll, sollte 0 zurückgeben } + + +void test_checkWin_Horizontal_X(void) { + char board[6][7] = { + {'X', 'X', ' ', ' ', ' ', ' ', ' '}, + {'O', 'O', 'O', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', 'X', 'X', 'X', 'X', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '} + }; + + TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'X')); // Horizontale Gewinnsituation für 'X' +} + + + + + + + + + + + + + + + + + + + + + From 389ca705ed111104f02495bb9145727ff6bad3f4 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 01:00:24 +0100 Subject: [PATCH 39/56] test_checkWin_Horizontal_O --- src/test/c/test_VierGewinnt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 8ad593b..f487364 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -43,7 +43,18 @@ void test_checkWin_Horizontal_X(void) { TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'X')); // Horizontale Gewinnsituation für 'X' } +void test_checkWin_Horizontal_O(void) { + char board[6][7] = { + {'X', 'X', ' ', ' ', ' ', ' ', ' '}, + {'O', 'O', 'O', 'O', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', 'X', 'X', ' ', 'X', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '} + }; + TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'O')); // Horizontale Gewinnsituation für 'X' +} From 3209502194d434c378be157aadc21d6e23703811 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 01:02:32 +0100 Subject: [PATCH 40/56] test_checkWin_Diagonal_X --- src/test/c/test_VierGewinnt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index f487364..73f89e0 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -56,6 +56,19 @@ void test_checkWin_Horizontal_O(void) { TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'O')); // Horizontale Gewinnsituation für 'X' } +void test_checkWin_Diagonal_X(void) { + char board[6][7] = { + {'X', 'X', ' ', ' ', ' ', ' ', ' '}, + {'O', 'O', 'O', 'X', ' ', ' ', ' '}, + {' ', 'X', ' ', ' ', ' ', ' ', ' '}, + {' ', 'X', 'X', 'X', 'X', ' ', ' '}, + {' ', ' ', ' ','X', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', 'X', ' '} + }; + + TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'X')); // Horizontale Gewinnsituation für 'X' +} + From fe1df3e2224f7c86bdbc02576a17661fc9cbf3da Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 01:04:02 +0100 Subject: [PATCH 41/56] test_checkWin_Diagonal_O --- src/test/c/test_VierGewinnt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 73f89e0..9681ea7 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -73,7 +73,18 @@ void test_checkWin_Diagonal_X(void) { +void test_checkWin_Diagonal_O(void) { + char board[6][7] = { + {'X', 'X', ' ', ' ', ' ', ' ', ' '}, + {'O', 'O', 'O', 'X', ' ', ' ', ' '}, + {' ', 'O', ' ', ' ', ' ', ' ', ' '}, + {' ', 'X', 'O', 'X', 'X', ' ', ' '}, + {' ', ' ', ' ','O', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', 'X', ' '} + }; + TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'O')); // Horizontale Gewinnsituation für 'X' +} From 8fa684587d69292a79be5d69aa0f03d20811e156 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 01:05:34 +0100 Subject: [PATCH 42/56] test_checkWin_Vertical_X --- src/test/c/test_VierGewinnt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 9681ea7..6896efe 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -92,7 +92,18 @@ void test_checkWin_Diagonal_O(void) { +void test_checkWin_Vertical_X(void) { + char board[6][7] = { + {'X', 'O', ' ', ' ', ' ', ' ', ' '}, + {'X', 'O', ' ', ' ', ' ', ' ', ' '}, + {'X', 'O', ' ', ' ', ' ', ' ', ' '}, + {'X', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '} + }; + TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'X')); // Vertikale Gewinnsituation für 'X' +} From 00da72c029afbda55cd5631e055d797bb16a7ff2 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 01:07:26 +0100 Subject: [PATCH 43/56] test_checkWin_Vertical_O --- src/test/c/test_VierGewinnt.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 6896efe..6569d15 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -107,5 +107,16 @@ void test_checkWin_Vertical_X(void) { +void test_checkWin_Vertical_O(void) { + char board[6][7] = { + {'X', 'O', ' ', ' ', ' ', ' ', ' '}, + {'X', 'O', ' ', ' ', ' ', ' ', ' '}, + {'X', 'O', ' ', ' ', ' ', ' ', ' '}, + {' ', 'O', ' ', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '}, + {' ', ' ', ' ', ' ', ' ', ' ', ' '} + }; + TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'O')); // Vertikale Gewinnsituation für 'X' +} From 30327565fe7dc0ac2eb2463d9e9db1693f8c7061 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 01:12:14 +0100 Subject: [PATCH 44/56] test_checkWin_NoWinner --- src/test/c/test_VierGewinnt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index 6569d15..efe7a13 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -119,4 +119,19 @@ void test_checkWin_Vertical_O(void) { TEST_ASSERT_EQUAL_INT(1, checkWin(board, 'O')); // Vertikale Gewinnsituation für 'X' } +void test_checkWin_NoWinner(void) { +char board[6][7] = { + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'} + }; + + + + TEST_ASSERT_EQUAL_INT(0, checkWin(board, 'X')); // Kein Gewinner, horizontale Reihe ist voll + TEST_ASSERT_EQUAL_INT(0, checkWin(board, 'O')); // Kein Gewinner, horizontale Reihe ist voll +} From 46ae979f08ff3c39ead782c4187b01db9989c6c2 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 15:23:03 +0100 Subject: [PATCH 45/56] test_isColumnFull --- src/test/c/test_VierGewinnt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/c/test_VierGewinnt.c b/src/test/c/test_VierGewinnt.c index efe7a13..1f14b9f 100644 --- a/src/test/c/test_VierGewinnt.c +++ b/src/test/c/test_VierGewinnt.c @@ -135,3 +135,17 @@ char board[6][7] = { TEST_ASSERT_EQUAL_INT(0, checkWin(board, 'X')); // Kein Gewinner, horizontale Reihe ist voll TEST_ASSERT_EQUAL_INT(0, checkWin(board, 'O')); // Kein Gewinner, horizontale Reihe ist voll } + +void test_isColumnFull(void) { + char board[6][7] = { + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'}, + {'X', 'O', 'X', 'O', 'X', 'O', 'X'}, + {'O', 'X', 'O', 'X', 'O', 'X', 'O'} + }; + + TEST_ASSERT_EQUAL_INT(1, isColumnFull(board, 3)); // Column 3 is full +} + From ff4961c714bd5b80b2078734227002a5e69e34e5 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 15:33:31 +0100 Subject: [PATCH 46/56] refactoring: change function name from showInvalidInputMessage() int showInvalidInputWarning() --- src/main/c/VierGewinnt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index c4d1419..ee289c8 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -49,7 +49,7 @@ int checkDiagonalRL(char board[ROWS][COLS], char player); // Funktionsprototyp für showMessage void showMessage(const char* messageColor, const char* message); //Funktionsprototyp für showInvalidInputMessage -void showInvalidInputMessage(); +void showInvalidInputWarning(); //Funktionsprototyp für showColumnFullMessage void showColumnFullMessage(); @@ -72,7 +72,7 @@ int main_function() { scanf("%d", &column); if (column < 1 || column > 7) { - showInvalidInputMessage(); + showInvalidInputWarning(); continue; } @@ -233,7 +233,7 @@ void showMessage(const char* messageColor, const char* message) { } // Write showInvalidInputMessage function -void showInvalidInputMessage() { +void showInvalidInputWarning() { showMessage(RED, "Ungültige Eingabe. Bitte wähle eine Spalte zwischen 1 und 7.\n"); } From 802e23fa9bc627e49f4fea738cc39896f2cbb0a7 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 15:36:35 +0100 Subject: [PATCH 47/56] refactoring: Ausgabetext Anpassen --- src/main/c/VierGewinnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index ee289c8..f91b268 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -242,7 +242,7 @@ void showInvalidInputWarning() { // Write showColumnFullMessage function void showColumnFullMessage() { - showMessage(RED, "Die Spalte ist voll. Bitte wähle eine andere.\n"); + showMessage(RED, "Die ausgewählte Spalte ist bereits belegt. Bitte wähle eine andere Spalte aus.\n"); } From 241aa5116b64d44149dc1d3f1ee9bd24d4052836 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 15:41:20 +0100 Subject: [PATCH 48/56] =?UTF-8?q?refactoring:=20Funktionsprototypen=20Anpa?= =?UTF-8?q?ssen=20und=20unn=C3=B6tige=20Kommentare=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index f91b268..65613cf 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -17,44 +17,18 @@ #define CYAN "\033[0;36m" #define WHITE "\033[0;37m" - -//Funktionsprototyp für initializeBoard +//Funktionsprototypen void initializeBoard(char board[ROWS][COLS]); - -//Funktionsprototyp für printBoard void printBoard(char board[ROWS][COLS]); - -// Funktionsprototyp für clearScreen void clearScreen(); - -//Funktionsprototyp für isColumnFull int isColumnFull(char board[ROWS][COLS], int col); - -//Funktionsprototyp für dropPiece int dropPiece(char board[ROWS][COLS], int col, char player); -//Funktionsprototyp für checkWin int checkWin(char board[ROWS][COLS], char player); -// Funktionsprototyp für checkHorizontal int checkHorizontal(char board[ROWS][COLS], char player); - -// Funktionsprototyp für checkVertical int checkVertical(char board[ROWS][COLS], char player); - -// Funktionsprototyp für checkDiagonalLR -int checkDiagonalLR(char board[ROWS][COLS], char player); - -// Funktionsprototyp für checkDiagonalRL int checkDiagonalRL(char board[ROWS][COLS], char player); - -// Funktionsprototyp für showMessage -void showMessage(const char* messageColor, const char* message); -//Funktionsprototyp für showInvalidInputMessage void showInvalidInputWarning(); - -//Funktionsprototyp für showColumnFullMessage void showColumnFullMessage(); - -//Funktionsprototyp für showWinMessage void showWinMessage(int player); From 651527c3bbe9472dc9521e19108853483de185e6 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 15:43:33 +0100 Subject: [PATCH 49/56] =?UTF-8?q?refactoring:=20unn=C3=B6tige=20Kommentare?= =?UTF-8?q?=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 65613cf..88b2b33 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -32,10 +32,9 @@ void showColumnFullMessage(); void showWinMessage(int player); -//Write starter function int main_function() { char board[ROWS][COLS]; - int currentPlayer = 1; // Spieler 1 beginnt + int currentPlayer = 1; initializeBoard(board); printBoard(board); @@ -70,7 +69,6 @@ int main_function() { return 0; } -// Write initializeBoard function void initializeBoard(char board[ROWS][COLS]) { for (int i = 0; i < ROWS; i++) { for (int j = 0; j < COLS; j++) { @@ -80,7 +78,6 @@ void initializeBoard(char board[ROWS][COLS]) { } -// Write printBoard function void printBoard(char board[ROWS][COLS]) { clearScreen(); printf("\n"); @@ -99,7 +96,6 @@ void printBoard(char board[ROWS][COLS]) { printf(" 1 2 3 4 5 6 7\n\n"); } -// Write clearScreen function void clearScreen() { #ifdef _WIN32 system("cls"); @@ -108,12 +104,10 @@ void clearScreen() { #endif } -// Write isColumnFull function int isColumnFull(char board[ROWS][COLS], int col) { return (board[0][col] != ' '); } -//Write dropPiece function int dropPiece(char board[ROWS][COLS], int col, char player) { for (int i = ROWS - 1; i >= 0; i--) { if (board[i][col] == ' ') { @@ -122,11 +116,10 @@ int dropPiece(char board[ROWS][COLS], int col, char player) { } } - return 0; // Column is full + return 0; } -// Write checkHorizontal function int checkHorizontal(char board[ROWS][COLS], char player) { for (int row = 0; row < ROWS; row++) { for (int col = 0; col <= COLS - 4; col++) { @@ -134,14 +127,13 @@ int checkHorizontal(char board[ROWS][COLS], char player) { board[row][col + 1] == player && board[row][col + 2] == player && board[row][col + 3] == player) { - return 1; // Gewonnen + return 1; } } } return 0; } -//Write checkVertical function int checkVertical(char board[ROWS][COLS], char player) { for (int col = 0; col < COLS; col++) { for (int row = 0; row <= ROWS - 4; row++) { @@ -149,7 +141,7 @@ int checkVertical(char board[ROWS][COLS], char player) { board[row + 1][col] == player && board[row + 2][col] == player && board[row + 3][col] == player) { - return 1; // Gewonnen + return 1; } } } @@ -158,7 +150,6 @@ int checkVertical(char board[ROWS][COLS], char player) { -// Write checkDiagonalLR function int checkDiagonalLR(char board[ROWS][COLS], char player) { for (int row = 0; row <= ROWS - 4; row++) { for (int col = 0; col <= COLS - 4; col++) { @@ -166,7 +157,7 @@ int checkDiagonalLR(char board[ROWS][COLS], char player) { board[row + 1][col + 1] == player && board[row + 2][col + 2] == player && board[row + 3][col + 3] == player) { - return 1; // Gewonnen + return 1; } } } @@ -176,7 +167,6 @@ int checkDiagonalLR(char board[ROWS][COLS], char player) { -// Write checkDiagonalRL function int checkDiagonalRL(char board[ROWS][COLS], char player) { for (int row = 0; row <= ROWS - 4; row++) { for (int col = 3; col < COLS; col++) { @@ -184,7 +174,7 @@ int checkDiagonalRL(char board[ROWS][COLS], char player) { board[row + 1][col - 1] == player && board[row + 2][col - 2] == player && board[row + 3][col - 3] == player) { - return 1; // Gewonnen + return 1; } } } @@ -192,7 +182,6 @@ int checkDiagonalRL(char board[ROWS][COLS], char player) { } -// Write checkWin function int checkWin(char board[ROWS][COLS], char player) { return checkHorizontal(board, player) || checkVertical(board, player) || @@ -201,12 +190,10 @@ int checkWin(char board[ROWS][COLS], char player) { } -// Write showMessage function void showMessage(const char* messageColor, const char* message) { printf("%s%s"RESET_COLOR, messageColor, message); } -// Write showInvalidInputMessage function void showInvalidInputWarning() { showMessage(RED, "Ungültige Eingabe. Bitte wähle eine Spalte zwischen 1 und 7.\n"); } @@ -214,14 +201,12 @@ void showInvalidInputWarning() { -// Write showColumnFullMessage function void showColumnFullMessage() { showMessage(RED, "Die ausgewählte Spalte ist bereits belegt. Bitte wähle eine andere Spalte aus.\n"); } -// Write showWinMessage function void showWinMessage(int player) { printf("Spieler %d hat gewonnen!\n", player); } From e4024a180d839af04327e00ad6ea77d4d13431c3 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 15:47:08 +0100 Subject: [PATCH 50/56] =?UTF-8?q?refactoring:=20=C3=84ndere=20variabel=20c?= =?UTF-8?q?urrentPlayer=20zu=20=20Player?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 88b2b33..711d018 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -34,14 +34,14 @@ void showWinMessage(int player); int main_function() { char board[ROWS][COLS]; - int currentPlayer = 1; + int Player = 1; initializeBoard(board); printBoard(board); int column; while (1) { - printf(YELLOW"Spieler %d, wähle eine Spalte (1-7): "RESET_COLOR, currentPlayer); + printf(YELLOW"Spieler %d, wähle eine Spalte (1-7): "RESET_COLOR, Player); scanf("%d", &column); if (column < 1 || column > 7) { @@ -56,14 +56,14 @@ int main_function() { continue; } - if (dropPiece(board, column, (currentPlayer == 1) ? 'X' : 'O')) { + if (dropPiece(board, column, (Player == 1) ? 'X' : 'O')) { printBoard(board); - if (checkWin(board, (currentPlayer == 1) ? 'X' : 'O')) { - showWinMessage(currentPlayer); + if (checkWin(board, (Player == 1) ? 'X' : 'O')) { + showWinMessage(Player); break; } - currentPlayer = (currentPlayer == 1) ? 2 : 1; + Player = (Player == 1) ? 2 : 1; } } From 382719583bd68c52c438b2a3fd0a25a6a4c684e4 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 16:03:50 +0100 Subject: [PATCH 51/56] =?UTF-8?q?refactoring:=20F=C3=BCge=20fdai-Nummer=20?= =?UTF-8?q?als=20Kommentar=20im=20Code=20f=C3=BCr=20Support=20hinzu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 711d018..a9bfaa0 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -1,3 +1,5 @@ +// Author fdai7726 + //Importiere wichtige Bibliotheken #include #include From af94b552d42d531c34c80df69749694aa45a0cd7 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 16:10:57 +0100 Subject: [PATCH 52/56] =?UTF-8?q?refactoring:=20Spiel=20Beschreibung=20als?= =?UTF-8?q?=20Kommentar=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index a9bfaa0..e6b84cc 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -1,5 +1,17 @@ // Author fdai7726 +/* +*Ein Vier-Gewinnt-Spiel, das in der Kommandozeile gespielt wird. +*Das Programm ermöglicht es zwei Spielern, abwechselnd Steine in eine Spalte zu setzen, +*um eine Reihe von vier Steinen horizontal, +*vertikal oder diagonal zu bilden und das Spiel zu gewinnen. +*Das Spielfeld wird grafisch in der Kommandozeile dargestellt, +*und das Programm überprüft automatisch, +*ob einer der Spieler gewonnen hat oder ob das Spielfeld voll ist. + */ + + + //Importiere wichtige Bibliotheken #include #include From a7cff576b79eebb61a1f8a93eaa9dce62280c352 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 16:15:55 +0100 Subject: [PATCH 53/56] =?UTF-8?q?refactoring:=20Gewinner=20Nachrricht=20?= =?UTF-8?q?=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/c/VierGewinnt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index e6b84cc..44b22ee 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -222,7 +222,8 @@ void showColumnFullMessage() { void showWinMessage(int player) { - printf("Spieler %d hat gewonnen!\n", player); +printf("Spieler %d ist der Gewinner!\n", player); + } From 7a8cd52f0d93e9dfe5d3a9debef99c43debe7070 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 16:17:39 +0100 Subject: [PATCH 54/56] refactoring: Funktion showMessage beschreiben --- src/main/c/VierGewinnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index 44b22ee..a8609ca 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -203,7 +203,7 @@ int checkWin(char board[ROWS][COLS], char player) { checkDiagonalRL(board, player); } - +// Die Funktion showMessage gibt eine formatierte Nachricht aus, wobei die Farbe der Nachricht dynamisch festgelegt werden kann. void showMessage(const char* messageColor, const char* message) { printf("%s%s"RESET_COLOR, messageColor, message); } From 3b75ec27be04597cc58e9d1bdaf276f1a1e3534c Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 16:22:30 +0100 Subject: [PATCH 55/56] refactoring: Beschreibung der Funktion showInvalidInputWarning() --- src/main/c/VierGewinnt.c | 2 ++ src/main/c/a.out | Bin 0 -> 10336 bytes 2 files changed, 2 insertions(+) create mode 100755 src/main/c/a.out diff --git a/src/main/c/VierGewinnt.c b/src/main/c/VierGewinnt.c index a8609ca..2072110 100644 --- a/src/main/c/VierGewinnt.c +++ b/src/main/c/VierGewinnt.c @@ -208,6 +208,8 @@ void showMessage(const char* messageColor, const char* message) { printf("%s%s"RESET_COLOR, messageColor, message); } +//Die Funktion showInvalidInputWarning zeigt eine Warnung für ungültige Benutzereingaben an. Sie ruft die Funktion showMessage auf, um die Nachricht in roter Farbe auszugeben, die den Benutzer darüber informiert, dass die Eingabe ungültig ist und er eine Spalte zwischen 1 und 7 wählen soll. + void showInvalidInputWarning() { showMessage(RED, "Ungültige Eingabe. Bitte wähle eine Spalte zwischen 1 und 7.\n"); } diff --git a/src/main/c/a.out b/src/main/c/a.out new file mode 100755 index 0000000000000000000000000000000000000000..b6a2002109ba2d4eef443ffc2d731c453a0436f7 GIT binary patch literal 10336 zcmc&)e{5XGao)R=B8sFW>X$8&mic5$2$@>P<8RS!VM?S_%B2mLavTLw@OZp?BCk5$ zo!=cTS(0HkG7trJP+uV=0-RP#;2@Ndp!&msNx+EhC_o(42FDuh-rUkH@sCb`~Ew=}HHFp_~n$D$k zh8-bP!^ zX|Fl^Og86?H4i6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g;4Cd-bxZuA)i`^x#_CNIoIS2RWUa=jJvT^IHq==3b!abn~S%s6Dy~xT6SjDe^26haWZX`TkKxisJ(+M^bBB^M z=0vEa7J8NK@D^?R(BS?@584MG>$7cQYiIj${rC9b!NZRoe!|{AIJp1IsI_fh@eslq>aW`b2bfcLJj4WL##BG%h!dw(Y-rq>)TSlZn&L zfppZ3o4ZI)wsb8ynm&0r^)xu+hf|sH+?S$m3U_TPk?l<<$H!8K#*;~v1yi~BsFTe` zM;wLSO6KtdwiycdZm|7^h{G_Q)bH`)Hy1Vh233oe(~u zt*E0tx0GeyE!09iC28Mp|9;f{r$=7C8-&VwEbWW^S}9(Cfrsj(efcgCdRiEn`u$J) zF|tYI<-1Gh5X<@77yr?|jpPq7pL}--eaR!g4SBI&A^Cu00sr{ZzLDA& z`O^0kPn-#s6C(RfDgP}pgvt2GcY*w!kDuRf|92rvF)s4*{V>n%-%kEVklo~wFMVh5 z7WQ`Xv>&CuOZ&2)l)rD1zhk2LLrLrxy*~v;{u6omJC9jD2(VD+O(HMY&yn%U>x*)# z>{f7j*b_m|&?EVUoO<4qzz=LL}`UP?l7r&o%7UBRyiA1oZ@ s`9wtvkF+oI?_Yt5?Z}qWdEP(XEFmT%?Fu}P%u4bTyl=F9^T#j$-$UwV$N&HU literal 0 HcmV?d00001 From 8aea03cf9826bf6db11a2dcfd9dbe91656befc02 Mon Sep 17 00:00:00 2001 From: fdai7726 Date: Wed, 7 Feb 2024 17:48:21 +0000 Subject: [PATCH 56/56] Delete a.out --- src/main/c/a.out | Bin 10336 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 src/main/c/a.out diff --git a/src/main/c/a.out b/src/main/c/a.out deleted file mode 100755 index b6a2002109ba2d4eef443ffc2d731c453a0436f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10336 zcmc&)e{5XGao)R=B8sFW>X$8&mic5$2$@>P<8RS!VM?S_%B2mLavTLw@OZp?BCk5$ zo!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