|
@ -50,19 +50,11 @@ void test_isValidMove_gueltigerZug(void) { |
|
|
void test_checkWinner_vertikalerGewinner(void) { |
|
|
void test_checkWinner_vertikalerGewinner(void) { |
|
|
/* arrangieren */ |
|
|
/* arrangieren */ |
|
|
char result; |
|
|
char result; |
|
|
char board[3][3]; |
|
|
|
|
|
|
|
|
|
|
|
// Initialisiere das Spielfeld |
|
|
|
|
|
for (int i = 0; i < BOARD_SIZE; i++) { |
|
|
|
|
|
for (int j = 0; j < BOARD_SIZE; j++) { |
|
|
|
|
|
board[i][j] = (char)('1' + i * BOARD_SIZE + j); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Setze die Daten für einen vertikalen Gewinner |
|
|
// Setze die Daten für einen vertikalen Gewinner |
|
|
board[0][0] = 'O'; |
|
|
|
|
|
board[1][0] = 'O'; |
|
|
|
|
|
board[2][0] = 'O'; |
|
|
|
|
|
|
|
|
makeMove(1); |
|
|
|
|
|
makeMove(4); |
|
|
|
|
|
makeMove(7); |
|
|
|
|
|
|
|
|
/* handeln */ |
|
|
/* handeln */ |
|
|
result = checkWinner(); |
|
|
result = checkWinner(); |
|
@ -74,19 +66,10 @@ void test_checkWinner_vertikalerGewinner(void) { |
|
|
void test_checkWinner_horizontalerGewinner(void) { |
|
|
void test_checkWinner_horizontalerGewinner(void) { |
|
|
/* arrangieren */ |
|
|
/* arrangieren */ |
|
|
char result; |
|
|
char result; |
|
|
char board[3][3]; |
|
|
|
|
|
|
|
|
|
|
|
// Initialisiere das Spielfeld |
|
|
|
|
|
for (int i = 0; i < BOARD_SIZE; i++) { |
|
|
|
|
|
for (int j = 0; j < BOARD_SIZE; j++) { |
|
|
|
|
|
board[i][j] = (char)('1' + i * BOARD_SIZE + j); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Setze die Daten für einen horizontalen Gewinner |
|
|
|
|
|
board[0][0] = 'X'; |
|
|
|
|
|
board[0][1] = 'X'; |
|
|
|
|
|
board[0][2] = 'X'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
makeMove(1); |
|
|
|
|
|
makeMove(2); |
|
|
|
|
|
makeMove(3); |
|
|
|
|
|
|
|
|
/* handeln */ |
|
|
/* handeln */ |
|
|
result = checkWinner(); |
|
|
result = checkWinner(); |
|
|