srand in C - with just one repetition
问题 I'm trying to build a memory game and I want to ask how I can generate a randomic number with just one repetition. Like 1-1, 2-2, 3-3. I will paste here my function that I created and tell me if I have to create another function just to create a condition to create just a pair from numbers. // function to fulfill the table void preencher_mesa(int matriz[4][4], int dificuldade) { int i, j; int lim_col, lim_linha; // limits of the matriz for(i=0; i<4; i++) for(j=0; j<4; j++) matriz[i][j] = 0;