COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers
COMPLETELY random numbers COMPLETELY random numbers
COMPLETELY random numbers
Go Back  Xtreme Visual Basic Talk > > > COMPLETELY random numbers


Reply
 
Thread Tools Display Modes
  #1  
Old 01-24-2004, 01:03 AM
loverde33 loverde33 is offline
Newcomer
 
Join Date: Jan 2004
Posts: 4
Default COMPLETELY random numbers


I was playing around with random number generators to see if i could get them to be completely random, when i thought of an idea. is there any way to constantly generate random numbers while the rest of your program runs and waits for user imput?
Reply With Quote
  #2  
Old 01-24-2004, 01:21 AM
loverde33 loverde33 is offline
Newcomer
 
Join Date: Jan 2004
Posts: 4
Default

One other thing, can you do this so it does not take up all your cpu power? like generate them every second or so? maybe less
Reply With Quote
  #3  
Old 01-25-2004, 05:07 AM
JimCamel's Avatar
JimCamelCOMPLETELY random numbers JimCamel is offline
Mostly Absent

* Expert *
 
Join Date: Jun 2002
Location: Christchurch, New Zealand
Posts: 2,006
Default

Depending on how your program is waiting for user input, you could quite easily just have a loop running which every second generates a random number. Just throw some DoEvents in there (are they still around in VB .Net?) and it shouldn't take all the cpu power. Otherwise you could just use a timer or something.
__________________
Sometimes it happens feelings die, Whole years are lost in the blink of an eye
We once had it all but event conspired, Sometimes
Now that it's over, it is through, It gets me everytime I think of you
Sometimes It happens, feelings die, Sometimes
Reply With Quote
  #4  
Old 01-25-2004, 08:02 AM
reboot's Avatar
rebootCOMPLETELY random numbers reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,614
Default

Quote:
Originally Posted by JimCamel
Just throw some DoEvents in there (are they still around in VB .Net?) and it shouldn't take all the cpu power.

Application.DoEvents
Reply With Quote
  #5  
Old 01-25-2004, 12:40 PM
Optikal's Avatar
OptikalCOMPLETELY random numbers Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

I have to ask, why on earth would you want your program to just sit around generating random numbers?
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #6  
Old 01-25-2004, 02:09 PM
Iceplug's Avatar
IceplugCOMPLETELY random numbers Iceplug is offline
MetaCenturion

Retired Moderator
* Guru *
 
Join Date: Aug 2001
Location: Iowa, USA
Posts: 16,583
Default

I would assume that loverde wants a 'more random number' by having the computer sit around making random numbers and having the program 'reach into' the stream of random numbers to get one.

loverde: You could probably just generate a whole bunch of random numbers at the start into an array, and just get the number from the array by using the milliseconds of time as the index.
__________________

Iceplug, USN
Quadrill 1 Quadrill 2 (full) Quadrill 3 JumpCross .NET Website is ALIVE! - DL Platform Tour for VB.NET! Posting Guidelines Hint: Specify your location in your user cp profile if you want compassion!
Reply With Quote
  #7  
Old 01-25-2004, 03:49 PM
Optikal's Avatar
OptikalCOMPLETELY random numbers Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

I doubt that would be any more random than just using the RNG as is.
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #8  
Old 01-25-2004, 05:25 PM
JimCamel's Avatar
JimCamelCOMPLETELY random numbers JimCamel is offline
Mostly Absent

* Expert *
 
Join Date: Jun 2002
Location: Christchurch, New Zealand
Posts: 2,006
Default

My thoughts were that loverde wanted some sort of "high tech interface" with a constantly updating random number.

Though I could be wrong.
__________________
Sometimes it happens feelings die, Whole years are lost in the blink of an eye
We once had it all but event conspired, Sometimes
Now that it's over, it is through, It gets me everytime I think of you
Sometimes It happens, feelings die, Sometimes
Reply With Quote
  #9  
Old 01-28-2004, 12:09 AM
loverde33 loverde33 is offline
Newcomer
 
Join Date: Jan 2004
Posts: 4
Default

hey i think that most of the ideas would work but, since i am just a beggining programmer i don't want to get to far i over my head. i just want a constantly updated random number like jim said. just one question: which do you think would be the simpilest for me? i have a semester long vb project(yes i'm in high school) and i need a way to start working on learning and applying the language.
Reply With Quote
  #10  
Old 01-28-2004, 07:00 AM
JimCamel's Avatar
JimCamelCOMPLETELY random numbers JimCamel is offline
Mostly Absent

* Expert *
 
Join Date: Jun 2002
Location: Christchurch, New Zealand
Posts: 2,006
Default

A timer which just generates a random number would be the easiest way.
__________________
Sometimes it happens feelings die, Whole years are lost in the blink of an eye
We once had it all but event conspired, Sometimes
Now that it's over, it is through, It gets me everytime I think of you
Sometimes It happens, feelings die, Sometimes
Reply With Quote
  #11  
Old 02-24-2004, 04:58 PM
Bucky's Avatar
BuckyCOMPLETELY random numbers Bucky is offline
A+ Certified Nerd

Retired Leader
* Expert *
 
Join Date: Dec 2001
Location: East Coast
Posts: 1,763
Default

For generating many rapid random numbers, I like to call
System.Threading.Thread.Sleep(1) to let a millisecond pass so that the
next random number will be different than the previous one in the loop,
since the random number is based on the milliseconds your computer has
been running.
__________________
If you're not part of the solution, you're part of the precipitate.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Random Numbers BillSoo Tutors' Corner 9 09-09-2006 01:45 PM
generating random numbers for the lottery mediaeval General 1 10-28-2003 01:27 PM
random numbers not so random * need help Davy Depuydt General 4 08-26-2003 06:47 AM
Long random number generation loquin Code Library 0 05-01-2003 05:45 PM
Random Numbers... please help me Kathy2002 General 16 01-26-2002 07:40 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers COMPLETELY random numbers
COMPLETELY random numbers
COMPLETELY random numbers
 
COMPLETELY random numbers
COMPLETELY random numbers
 
-->