//Copyable according to users inputBoard(int rows, int

//Copyable Code :#include #include #define BLACK ‘#’#define WHITE ‘ ‘using namespace std;class Board{char **board;int rows, cols;public://Creating two- dimensional array according to users inputBoard(int rows, int cols){this->rows = rows;this->cols = cols;board = new char*rows;for(int i = 0; i < rows; i++){boardi = new charcols;}initialize();}  void initialize(){for(int i = 0; i < rows; i++){for(int j = 0; j < cols; j++){boardij = WHITE;}}}  void set(int row, int col, char c){if(isOnBoard(row,col))boardrowcol = c;}  char get(int row, int col){return boardrowcol;}  int getRows(){return rows;}  int getCols(){return cols;}  bool isOnBoard(int row, int col){if(0 <= row && rowboard = board;boardCell = board->get(row, col);board->set(row, col, getAnt());}void move(){int oldr = row, oldc = col;if(boardCell == WHITE) {turnRight();board->set(oldr, oldc, BLACK);moveForward();  }else{turnLeft();board->set(oldr, oldc, WHITE);moveForward();}  }  void turnLeft(){if(dir == NORTH)dir = WEST;else if(dir == SOUTH)dir = EAST;else if(dir == EAST)dir = NORTH;else if(dir == WEST)dir = SOUTH;}void turnRight(){if(dir == NORTH)dir = EAST;else if(dir == SOUTH)dir = WEST;else if(dir == EAST)dir = SOUTH;else if(dir == WEST)dir = NORTH;}  void moveForward(){//Logic for moving upif(dir == NORTH) {row — ;if(row < 0)row = board->getRows() – 1;}//Logic for moving downelse if(dir == SOUTH){row ++;if(row == board->getRows())row = 0;}else if(dir == WEST){col –;if(col < 0)col = board->getCols() – 1;}else if(dir == EAST){col ++;if(col == board->getCols())col = 0;}boardCell = board->get(row, col);board->set(row, col, getAnt());board->display();}char getAnt(){return ‘*’;}};int main(){int rows, cols;int sr, sc;cout <<"Please enter the size of the board : ";cin >> rows >> cols;cout <<"Please mention the starting point of the ant : ";cin >> sr >> sc;Board *board= new Board(rows, cols);Ant ant(board, sr, sc);while(true){ant.move();//Creating delaysleep(1);} }