- Oct 7, 2002
- 254
- 0
- 0
i've got 5x5 array "player1[5][5] (bingo card). Each element of the array is a random #. Column 1: 1-15, Column 2: 16-30, etc. I want to find if there are =duplicate numbers in each column, and if there are, call this function that'll generate a random number.
right now i have this...and it fills the array with the right numbers
for(int x=0;x<5;x++)
{
for(int y=0;y<5;y++)
{
//Random returns a random #. if x=0, returns 1-15, x=1, 16-30, etc.
player1[x][y]=Random(x);
player2[x][y]=Random(x);
}
}
I've been trying to do another for loop and what not to find the duplicate numbers, but i just haven't been able to figure it out.
right now i have this...and it fills the array with the right numbers
for(int x=0;x<5;x++)
{
for(int y=0;y<5;y++)
{
//Random returns a random #. if x=0, returns 1-15, x=1, 16-30, etc.
player1[x][y]=Random(x);
player2[x][y]=Random(x);
}
}
I've been trying to do another for loop and what not to find the duplicate numbers, but i just haven't been able to figure it out.