Improved AI's end game by detecting when the board is full