Description
I was wondering if someone can help me. I am trying to make a program that takes the last draw of a 6 49 lottery, break all 6 numbers in all 15 pairs, and then search each pair in the past draws to see where has hit recently. It shows how many draws elapsed since last hit. Then the next one most recent etc. The draws are in order with most recent at the top. I have a little source code from a guy but is not complete. If someone can help me with the code, update this code or something new:
// Here i see the 1-15 pirs
int int0, int1, int2, int3, int4, int5, int6;
int pair[15][3];
int foundul=0;
for (int0=0; int0<15; int0++)
{
pair[int0][0]=0;
pair[int0][1]=0;
pair[int0][2]=0;
}
// until here i make for each draw (ik) a new matrix, with zero all the values;
// starting from here i make the matrix of the pairs, according to history draws... this function executes each time ik changes, for every draw,
//starting from ik+1 to the end... (in my case 912). Normaly this 912 must be a variable, or input from keyboard by user,
for (int3=(ik+1); int3<912; int3++)
for (int4=0; int4<6; int4++)
for (int5=0; int5<6; int5++)
if (int4!=int5)
{
for (int1=0; int1<6; int1++)
for (int2=0; int2<6; int2++)
if ((tabel[ik][int1]==tabel[int3][int4])&&(tabel[ik][int2]==tabel[int3] [int5])&&(int1!=int2))
{
int found=0;
for (int6=0; int6<15; int6++)
{
if ((tabel[int3][int4]==pair[int6][0])&&(tabel[int3][int5]==pair[int6][1]))
found=found+1;
if ((tabel[int3][int4]==pair[int6][1])&&(tabel[int3][int5]==pair[int6][0]))
found=found+1;
}
if (found==0) foundul=foundul+1;
if (found==0) pair[foundul-1][0]=tabel[ik][int1];
if (found==0) pair[foundul-1][1]=tabel[ik][int2];
if (found==0) pair[foundul-1][2]=(int3-ik);
}
}
// here i print the pairs
int int13;
for (int13=0; int13<15; int13++)
{
fprintf (fp, "\n%d %d %d pair no %d", pair[int13][0], pair[int13][1], pair[int13][2], int13);
}
// Here i finish the 1-15 pairs
And the result should look like this:
pool no 1
12 44 2 pair no 0
30 44 12 pair no 1
30 49 24 pair no 2
................
pool no 2
17 44 2 pair no 0
18 44 20 pair no 1
..........
12 44 is the pair
2 is the draws when last hit.
Explanation & Answer
pool no 1
12 44 2 pair no 0
30 44 12 pair no 1
30 49 24 pair no 2