'Pairwise Balanced Incomplete Block Design in C

I have to make a pairwise BIBD in C (using backtracking), but i don't know how to generate the blocks and check for pairs of points

I thought I could make a 2d array and store each block on a row but I don't know how to take it further than this

    {
        *(val+q) = q+1;
        printf("%d", *(val+q));

    }
            printf("\n");
    for(i=0;i<b;i++)
    {
        q = 0;
        for(j=0;j<k;j++)
        {
        *(m+i*k+j)= *(val+q);
        printf("%d ",*(m+i*k+j));
        q++;
        }

        printf(",");
    }

This generates B blocks, but each block is just 1234. The val array stores all point values from 1 to v, and q is just a pointer for that array.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source