Click here to Skip to main content
15,913,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generallittle problem with strings Pin
Stephan Wright14-Feb-05 6:39
Stephan Wright14-Feb-05 6:39 
GeneralRe: little problem with strings Pin
rwestgraham14-Feb-05 12:05
rwestgraham14-Feb-05 12:05 
GeneralRe: little problem with strings Pin
Stephan Wright14-Feb-05 21:08
Stephan Wright14-Feb-05 21:08 
GeneralRe: little problem with strings Pin
rwestgraham15-Feb-05 13:02
rwestgraham15-Feb-05 13:02 
GeneralRe: little problem with strings Pin
Stephan Wright15-Feb-05 21:04
Stephan Wright15-Feb-05 21:04 
GeneralRe: little problem with strings Pin
Stephan Wright15-Feb-05 21:51
Stephan Wright15-Feb-05 21:51 
GeneralVb . net 2003 mod function Pin
Anonymous14-Feb-05 6:19
Anonymous14-Feb-05 6:19 
GeneralRe: Vb . net 2003 mod function Pin
Dave Kreskowiak14-Feb-05 7:05
mveDave Kreskowiak14-Feb-05 7:05 
Why does this have the stench of homework around it?

Your constantly picking two random numbers and seeing if one divides evenly into the other. If it fails, you're picking two more, and so on, and so on... The chances of the RNG picking two number that divide evenly into each other are pretty low, so of course, it takes a long time to find two numbers that match your criteria.

I have no idea what your homework assignment is, but, how about picking a random number for one and then contantly trying random numbers to divide into it. In other words, pick a random number for label1, then in a do loop, keep picking random numbers until you find one that divides evenly into the first.

This will have the effect of trying to hit a stationary target, instead of a moving one.

There are other, much better ways of doing this, but, then again, it's your homework, isn't it?


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Vb . net 2003 mod function Pin
Anonymous14-Feb-05 8:43
Anonymous14-Feb-05 8:43 
GeneralRe: Vb . net 2003 mod function Pin
Dave Kreskowiak15-Feb-05 3:43
mveDave Kreskowiak15-Feb-05 3:43 
Generalget string array length Pin
Stephan Wright14-Feb-05 2:37
Stephan Wright14-Feb-05 2:37 
GeneralRe: get string array length Pin
Fawxes14-Feb-05 3:26
Fawxes14-Feb-05 3:26 
GeneralRe: get string array length Pin
Stephan Wright14-Feb-05 6:32
Stephan Wright14-Feb-05 6:32 
GeneralRe: get string array length Pin
Scott Serl14-Feb-05 8:44
Scott Serl14-Feb-05 8:44 
GeneralData Table or Business Object Pin
Fawxes13-Feb-05 23:58
Fawxes13-Feb-05 23:58 
GeneralInsufficient system resources Pin
sayhigh13-Feb-05 22:32
sayhigh13-Feb-05 22:32 
GeneralRe: Insufficient system resources Pin
Dave Kreskowiak14-Feb-05 1:28
mveDave Kreskowiak14-Feb-05 1:28 
GeneralRe: Insufficient system resources Pin
sayhigh14-Feb-05 1:34
sayhigh14-Feb-05 1:34 
GeneralRe: Insufficient system resources Pin
Dave Kreskowiak14-Feb-05 5:34
mveDave Kreskowiak14-Feb-05 5:34 
GeneralRe: Insufficient system resources Pin
Kirk Quinbar15-Apr-09 10:54
Kirk Quinbar15-Apr-09 10:54 
GeneralVB.NET Datasets Pin
Mahesh167913-Feb-05 22:11
Mahesh167913-Feb-05 22:11 
GeneralRe: VB.NET Datasets Pin
Dave Kreskowiak14-Feb-05 1:26
mveDave Kreskowiak14-Feb-05 1:26 
GeneralRe: VB.NET Datasets Pin
Virus Detecter16-Feb-05 0:28
Virus Detecter16-Feb-05 0:28 
GeneralTriggering Event - Access Form Pin
FuzMic13-Feb-05 19:29
FuzMic13-Feb-05 19:29 
GeneralRe: Triggering Event - Access Form Pin
Dave Kreskowiak14-Feb-05 5:18
mveDave Kreskowiak14-Feb-05 5:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.