diff --git a/src/c/funktionen.c b/src/c/funktionen.c index 5d112b6..d09e661 100644 --- a/src/c/funktionen.c +++ b/src/c/funktionen.c @@ -47,4 +47,10 @@ int x_wins_00_10_20(char board[][3]) { if (board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X') { return 1; } +} + +int x_wins_01_11_21(char board[][3]) { + if (board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X') { + return 1; + } } \ No newline at end of file diff --git a/src/test/test_funktionen.c b/src/test/test_funktionen.c index 09ca587..2f16f48 100644 --- a/src/test/test_funktionen.c +++ b/src/test/test_funktionen.c @@ -91,4 +91,19 @@ void test_x_wins_onIndex_00_10_20(void) TEST_ASSERT_EQUAL_INT(expected, actual); } +void test_x_wins_onIndex_01_11_21(void) +{ + /* arrange */ + int actual; + int expected = 1; + + char board[][3] = {{' ','X',' '}, {' ','X',' '}, {' ','X',' '}}; + + /* act */ + actual = x_wins_01_11_21(board); + + /* assert */ + TEST_ASSERT_EQUAL_INT(expected, actual); +} + #endif \ No newline at end of file