tictactoe_solver.cpp
// Checks if the row is blocked at the given position
//
// @param board the tictactoe board
// @param x the column position
// @param y the row position
//
// @return whether or not the row is blocked

Checks if the row is blocked at the given position
Checks if the row is blocked at the given position
bool tictactoeai::IsRowBlocked(const tictactoe::TicTacToe &board,
                               unsigned int x, unsigned int y)
{
  char piece = board.get_board_data()[x][y];
  if ((board.get_board_data()[0][y] == ' ' ||
       board.get_board_data()[0][y] == piece) &&
      (board.get_board_data()[1][y] == ' ' ||
       board.get_board_data()[1][y] == piece) &&
      (board.get_board_data()[2][y] == ' ' ||
       board.get_board_data()[2][y] == piece))
    return false;
  return true;
}
bool tictactoeai :: IsRowBlocked ( const tictactoe :: TicTacToe & board , unsigned int x , unsigned int y ) { char piece = board . get_board_data ( ) [ x ] [ y ] ; if ( ( board . get_board_data ( ) [ 0 ] [ y ] == ' ' || board . get_board_data ( ) [ 0 ] [ y ] == piece ) && ( board . get_board_data ( ) [ 1 ] [ y ] == ' ' || board . get_board_data ( ) [ 1 ] [ y ] == piece ) && ( board . get_board_data ( ) [ 2 ] [ y ] == ' ' || board . get_board_data ( ) [ 2 ] [ y ] == piece ) ) return false ; return true ; }
Checks if the row is blocked at the given position
Checks if the row is blocked at the given position