PLEASE, READ THE EDIT PART
I guess I might use delegates. But I'm not certain if I can apply for it.
private int[] Generate_Fraction(int li1, int ls1, int li2, int ls2)
{
int numerator = randomizer.Next(li1, ls1);
int denominator = randomizer.Next(li2, ls2);
int[] fraction = new int[2];
fraction[0] = numerator;
fraction[1] = denominator;
return fraction;
}
// Decimals
private double[] GeneratePattern5(double[][] limits)
{
double[] decimals = new double[limits.Length];
for (int i = 0; i < limits.Length; i++)
{
bool flag;
double decTemp;
do
{
flag = false;
decTemp = GetDoubleBetween(limits[i][0], limits[i][1], (int)limits[i][2]);
if (Exists(decimals, decTemp, i))
{
flag = true;
}
} while (flag);
decimals[i] = decTemp;
}
return decimals;
}
// Fractions like: 6/60
private int[][] GeneratePattern7(int[][] arrayLimits)
{
int[][] fractions = new int[arrayLimits.Length][];
for (int i = 0; i < arrayLimits.Length; i++)
{
bool flag;
int[] fracTemp = new int[2];
do
{
flag = false;
fracTemp = Generate_Fraction(arrayLimits[i][0], arrayLimits[i][1], arrayLimits[i][2], arrayLimits[i][3]);
fracTemp[1] *= fracTemp[0];
if (Exists(fractions, fracTemp, i))
{
flag = true;
}
} while (flag);
fractions[i] = fracTemp;
}
return fractions;
}
EDIT
Well, here is the project which currently I'm working.
http://www.megaupload.com/?d=NGJWS9C3
Sorry guys if the code is a mess. I'm a beginner, I'm still learning from you, and for that reason, I need a little of help to improve this code. It's not finished.
I'm creating a Math quiz system. And there are many questions as you will be able to see in it, they're so different and I have a difficult momment to create the classes.
Greetings.