M
Mick Walker
I have the following class:
class Axis
{
private int _num1;
private int _num2;
private int _num3;
public int Num1 {
get { return _num1; }
set { _num1 = value; }
}
public int Num2 {
get { return _num2; }
set { _num2 = value; }
}
public int Num3 {
get { return _num3; }
set { _num3 = value; }
}
public Lotto() {
}
public Lotto(int[] ExcludedNumbers) {
// Initialise variable to random numbers not in the above array
}
}
What I would like, to be able to do is initialise this class setting
Num1, Num2, Num3 to random values (they must differ from each other).
However when I initialise it, passing an array of integer I would like
Num1, Num2, Num3 to be initialised to random values, but if the value
exists in the ExcludedNumbers array, a different random value should be
used, as before, these values should all differ from each other.
If someone could help that would be great, I'm not nessesarily looking
for a code soloution, but just some help on they way.
Kind Regards
Mick Walker
class Axis
{
private int _num1;
private int _num2;
private int _num3;
public int Num1 {
get { return _num1; }
set { _num1 = value; }
}
public int Num2 {
get { return _num2; }
set { _num2 = value; }
}
public int Num3 {
get { return _num3; }
set { _num3 = value; }
}
public Lotto() {
}
public Lotto(int[] ExcludedNumbers) {
// Initialise variable to random numbers not in the above array
}
}
What I would like, to be able to do is initialise this class setting
Num1, Num2, Num3 to random values (they must differ from each other).
However when I initialise it, passing an array of integer I would like
Num1, Num2, Num3 to be initialised to random values, but if the value
exists in the ExcludedNumbers array, a different random value should be
used, as before, these values should all differ from each other.
If someone could help that would be great, I'm not nessesarily looking
for a code soloution, but just some help on they way.
Kind Regards
Mick Walker