diff --git a/src/c/ticTacToe.c b/src/c/ticTacToe.c index 3cc5280..7d2105f 100644 --- a/src/c/ticTacToe.c +++ b/src/c/ticTacToe.c @@ -38,14 +38,14 @@ void getPlayerInput(char field[3][3]){ scanf("%d %d", &row, &col); row -= 1; col -= 1; - if(validateUserInput(row, col)){ + if(validatePlayerInput(row, col)){ field[row][col] = 'O'; - valid = validateUserInput(row, col); + valid = validatePlayerInput(row, col); } } } -bool validateUserInput(int row, int col){ +bool validatePlayerInput(int row, int col){ if (row < 3 && row >= 0){ if (col < 3 && col >= 0){ return true; @@ -136,4 +136,5 @@ int wasGameWon(char field[3][3]){ } } return winner; -} \ No newline at end of file +} + diff --git a/src/c/ticTacToe.h b/src/c/ticTacToe.h index 9bca53a..ec68f18 100644 --- a/src/c/ticTacToe.h +++ b/src/c/ticTacToe.h @@ -13,7 +13,7 @@ void printPrompt(); void printField(char field[3][3]); void initField(char field[3][3]); void getPlayerInput(char field[3][3]); -bool validateUserInput(int row, int col); +bool validatePlayerInput(int row, int col); int wasGameWon(char field[3][3]); #endif \ No newline at end of file diff --git a/test/c/test_ticTacToe.c b/test/c/test_ticTacToe.c index 69870d1..140ce7a 100644 --- a/test/c/test_ticTacToe.c +++ b/test/c/test_ticTacToe.c @@ -18,7 +18,7 @@ void test_ticTacToe_validUserInput(void) int row = 2, col = 0; /* act */ - result = validateUserInput(row, col); + result = validatePlayerInput(row, col); /* assert */ TEST_ASSERT_EQUAL_INT(true, result); @@ -31,7 +31,7 @@ void test_ticTacToe_invalidUserInput(void) int row = 1, col = 3; /* act */ - result = validateUserInput(row, col); + result = validatePlayerInput(row, col); /* assert */ TEST_ASSERT_EQUAL_INT(false, result);