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