I need code in VB for combinations
For example k of n numbers (6 of 45) for lottary
For example k of n numbers (6 of 45) for lottary
int1 = 1 + Rnd() * 44 int2 = 1 + Rnd() * 44 [INDENT]Do While int1 = int2 int2 = 1 + Rnd() * 44 Loop[/INDENT] int3 = 1 + Rnd() * 44[INDENT]Do While int1 = int3 Or int2 = int3 int3 = 1 + Rnd() * 44 Loop[/INDENT] int4 = 1 + Rnd() * 44[INDENT]Do While int1 = int4 Or int2 = int4 Or int3 = int4 int4 = 1 + Rnd() * 44 Loop[/INDENT] int5 = 1 + Rnd() * 44[INDENT]Do While int1 = int5 Or int2 = int5 Or int3 = int5 Or int4 = int5 int5 = 1 + Rnd() * 44 Loop[/INDENT] int6 = 1 + Rnd() * 44[INDENT]Do While int1 = int6 Or int2 = int6 Or int3 = int6 Or int4 = int6 Or int5 = int6 int6 = 1 + Rnd() * 44 Loop[/INDENT]
Comment