diff --git a/src/main/c/GameTic_Tac_Toe/tictactoe.c b/src/main/c/GameTic_Tac_Toe/tictactoe.c index e15cf80..84a2430 100644 --- a/src/main/c/GameTic_Tac_Toe/tictactoe.c +++ b/src/main/c/GameTic_Tac_Toe/tictactoe.c @@ -8,6 +8,12 @@ char currentPlayer = 'X'; const char PLAYER_X = 'X'; const char PLAYER_O = 'O'; +void reset_board(){ + board[3][3] = {{'1', '2', '3'}, + {'4', '5', '6'}, + {'7', '8', '9'}}; +} + // Funktionen zur Anzeige des Spielbretts void displayBoard() { printf("Tic-Tac-Toe\n"); diff --git a/src/main/c/GameTic_Tac_Toe/tictactoe.h b/src/main/c/GameTic_Tac_Toe/tictactoe.h index 89d5ab9..d007eb4 100644 --- a/src/main/c/GameTic_Tac_Toe/tictactoe.h +++ b/src/main/c/GameTic_Tac_Toe/tictactoe.h @@ -9,5 +9,6 @@ void start_tictactoe(); char checkWinner(); void makeMove(int choice); void displayBoard(); +void reset_board(); #endif diff --git a/test/test_tictactoe.c b/test/test_tictactoe.c index b72d780..a74a3da 100644 --- a/test/test_tictactoe.c +++ b/test/test_tictactoe.c @@ -8,6 +8,7 @@ void setUp(void){ //Wenn Funktion Vorraussetzungen braucht } void tearDown(void){ + printf("1\n"); } @@ -65,6 +66,7 @@ void test_checkWinner_vertikalerGewinner(void) { /* überprüfen */ TEST_ASSERT_EQUAL_CHAR('O', result); + reset_board(); } void test_checkWinner_horizontalerGewinner(void) { @@ -84,6 +86,7 @@ void test_checkWinner_horizontalerGewinner(void) { /* überprüfen */ TEST_ASSERT_EQUAL_CHAR('X', result); + reset_board() } #endif // TEST