Im trying to make a game where it players can answer math equations in a 2D way, almost like sudoku. The operands need to be randomised for each new games aswell as the operators. Ive gotten to the point where I can make it in a 1D array, but cant figure out how to solve both column and rowwise functions.. could anyone make some suggestions to point in the right direction..
i can upload my code if that helps.. Thanks in advance.
    int by4equations (int num[2][2] ) {
    
    srand( time(0) ); 
    num [2][2] = {
                {(rand() % 9+1),(rand() % 9+1)},
                {(rand() % 9+1),(rand() % 9+1)} 
                    } ;
    int operator, sum = 0 ; 
    int i, j ;
        
    operator = rand()%4 ;  
}
    if (operator == 0)
        for(i = 0; i < 2; i++){
            for(j = 0; j < 2; j++){
        sum = num[i][j]  + num[i][j];
        }}
    else if (operator == 1){
        for(i = 0; i < 2; i++){
            for(j = 0; j < 2; j++){
        sum = num[i][j] * num[i][j];
        }}}
    else if (operator == 2){
        for(i = 0; i < 2; i++){
            for(j = 0; j < 2; j++){
        sum = num[i][j] / num[i][j] ;   
        }}}
    else if  (operator == 3){
         for(i = 0; i < 2; i++){
            for(j = 0; j < 2; j++){
        sum = num[i][j] - num[i][j];
        }}}
edit : something like this is what i want https://www.google.com/url?sa=i&url=http%3A%2F%2Fwww.tamaraladamsauthor.com%2Fday-15-stuck-at-home-free-activity-math-square%2F&psig=AOvVaw3ohQWT7Hen-ewfXGvKSYVf&ust=1630711269359000&source=images&cd=vfe&ved=0CAsQjRxqFwoTCJDq6oO34fICFQAAAAAdAAAAABAD
