Q:

Why -doesn't- this while loop endlessly loop?

*Edit appended to bottom of post.
I've trying to generate some code in C that generates a 2D array that has 10 rows and 2 columns.  I have created a check to see if, when a row is generated, that if it is identical to another existing row it will keep changing it's values until it is a new unique row.
I've currently set the maximum variables to only 1 in order to verify that the while loop should never terminate since there aren't 10 unique combinations of 0 and 1 that it could possibly find.  This code does indeed find duplicates and change accordingly but seems to skip the check eventually and terminates instead of endlessly looping like it should.  The printf functions are used to probe the behavior of my code.
Why does my while loop terminate?
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>

int main (int argc, char *argv[]) {
    int max_x = 1, max_y = 1;
    int num_pt = 10;
    int array[num_pt][2];
    srand(time(0));

    //Generate a new file
    if (argc == 1) {
        printf("Generating instances\n");
        for (int i = 0 ; i < num_pt ; i++) {
            array[i][0] = rand()%(max_y+1);
            array[i][1] = rand()%(max_x+1);
            for (int j = i-1 ; j >= 0 ; j-- ) {
                while ((array[i][0] == array[j][0]) && (array[i][1] == array[j][1])) {
                    printf("\narray[%d][0]/[%d][1] and array[%d][0]/[%d][1]: Duplicate exists", i, i, j, j);
                    array[i][0] = rand()%(max_y+1);
                    array[i][1] = rand()%(max_x+1);
                }
            }
        }
        for (int j = 0 ; j < num_pt ; j++) {
            printf("\nRow[%d] = [%d][%d]", j, array[j][0], array[j][1]);
        }
    return 1;
    }
}

Sample Output:
Generating instances

array[2][0]/[2][1] and array[0][0]/[0][1]: Duplicate exists
array[2][0]/[2][1] and array[0][0]/[0][1]: Duplicate exists
array[3][0]/[3][1] and array[1][0]/[1][1]: Duplicate exists
array[4][0]/[4][1] and array[1][0]/[1][1]: Duplicate exists
array[5][0]/[5][1] and array[1][0]/[1][1]: Duplicate exists
array[6][0]/[6][1] and array[4][0]/[4][1]: Duplicate exists
array[6][0]/[6][1] and array[2][0]/[2][1]: Duplicate exists
array[6][0]/[6][1] and array[0][0]/[0][1]: Duplicate exists
array[7][0]/[7][1] and array[6][0]/[6][1]: Duplicate exists
array[7][0]/[7][1] and array[0][0]/[0][1]: Duplicate exists
array[8][0]/[8][1] and array[4][0]/[4][1]: Duplicate exists
array[8][0]/[8][1] and array[2][0]/[2][1]: Duplicate exists
array[8][0]/[8][1] and array[0][0]/[0][1]: Duplicate exists
array[9][0]/[9][1] and array[8][0]/[8][1]: Duplicate exists
array[9][0]/[9][1] and array[6][0]/[6][1]: Duplicate exists
array[9][0]/[9][1] and array[6][0]/[6][1]: Duplicate exists
array[9][0]/[9][1] and array[0][0]/[0][1]: Duplicate exists
array[9][0]/[9][1] and array[0][0]/[0][1]: Duplicate exists
Row[0] = [1][1]
Row[1] = [1][0]
Row[2] = [0][0]
Row[3] = [0][1]
Row[4] = [0][1]
Row[5] = [0][0]
Row[6] = [1][0]
Row[7] = [0][0]
Row[8] = [0][1]
Row[9] = [0][1]

------------------
(program exited with code: 1)
Press return to continue

Thanks for the help.  It finally dawned on me as I I lay in bed thinking about it last night.  My solutions is to add a counter that would re-run the entire check if it found any row that was redundants.
int main (int argc, char *argv[]) {
    int max_x = 2, max_y = 2;
    int num_pt = 9;
    int array[num_pt][2];
    srand(time(0));
    int rerun = 1;

    //Generate a new file
    if (argc == 1) {
        printf("Generating instances\n");
        for (int i = 0 ; i < num_pt ; i++) {
            array[i][0] = rand()%(max_y+1);
            array[i][1] = rand()%(max_x+1);
            rerun++;
            while (rerun != 0) {
                rerun = 0;
                for (int j = i-1 ; j >= 0 ; j-- ) {
                    if (array[i][0] == array[j][0] && array[i][1] == array[j][1]) {
                        printf("\narray[%d][0]/[%d][1] and array[%d][0]/[%d][1]: Duplicate exists", i, i, j, j);
                        array[i][0] = rand()%(max_y+1);
                        array[i][1] = rand()%(max_x+1);
                        rerun++;
                    }
                }
            }
        }
        for (int j = 0 ; j < num_pt ; j++) {
            printf("\nRow[%d] = [%d][%d]", j, array[j][0], array[j][1]);
        }
    return 1;
    }
}

This way works but if anyone has a more efficient way of doing this I'm all ears.

A:

Wrong order of loops.
Your inner while loop only keeps checking the same pair over and over again until it finds a valid combination for that specific pair.
When it does, it has likely already broken compatibility with another element though. As your outer and middle loop will never revisit pairs which had already worked once, this goes completely unnoticed.

