diff --git a/src/c/ticTacToe.c b/src/c/ticTacToe.c index 4884cc2..1d77f9b 100644 --- a/src/c/ticTacToe.c +++ b/src/c/ticTacToe.c @@ -274,24 +274,32 @@ void fillAlmostFull(char field[3][3], bool* pt) { } if (field[1][0] == 'X') { if (field[1][1] == 'X') { + if( field[1][2] = '-'){ field[1][2] = 'X'; *pt = true; return; + } } else if (field[1][2] == 'X') { + if( field[1][1] = '-'){ field[1][1] = 'X'; *pt = true; return; + } } else if (field[0][0] == 'X') { + if( field[2][0] = '-'){ field[2][0] = 'X'; *pt = true; return; + } } else if (field[2][0] == 'X') { + if( field[0][0] = '-'){ field[0][0] = 'X'; *pt = true; return; + } } } if (field[1][1] == 'X') { @@ -565,24 +573,32 @@ void fillAlmostFull(char field[3][3], bool* pt) { } if (field[1][0] == 'O') { if (field[1][1] == 'O') { + if( field[1][2] = '-'){ field[1][2] = 'X'; *pt = true; return; + } } else if (field[1][2] == 'O') { + if( field[1][1] = '-'){ field[1][1] = 'X'; *pt = true; return; + } } else if (field[0][0] == 'O') { + if( field[2][0] = '-'){ field[2][0] = 'X'; *pt = true; return; + } } else if (field[2][0] == 'O') { + if( field[0][0] = '-'){ field[0][0] = 'X'; *pt = true; return; + } } } if (field[1][1] == 'O') {