Could someone please tell me what is happening in this portion of code? it's for a Minesweeper game and it's the only part I can't understand. If you need context, let me know and I'll add the entire codevoid create_mine_positions(){int counter = 0;srand(time(NULL));for (int row = 0; row<10; row++)    for (int cols = 0; cols<10; cols++)        table_mine_positions[row][cols] = '0';int row = 0;int cols = 0;while (counter<10){    int row = rand() % 10;    int cols = rand() % 10;    if (table_mine_positions[row][cols] == '0') {        table_mine_positions[row][cols] = 'X';        cell_number(row - 1, cols);        cell_number(row + 1, cols);        cell_number(row, cols - 1);        cell_number(row, cols + 1);        cell_number(row - 1, cols - 1);        cell_number(row - 1, cols + 1);        cell_number(row + 1, cols - 1);        cell_number(row + 1, cols + 1);        counter++;    }}}
I can't figure out this portion of code in C++ . Could someone please explain it to me?
c++