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; } }