![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Posts: 28
Rep Power: 0
![]() |
time Delays and Random functions
How do i write Time delay functions or instructions?
Like Delay for 40us or 80ms? But how do i make them "overlap" if i had multiple time delays going on? How do u modify or manipulate the random function? Where can i get external random function librarys or librarys that have different random functions? Each programming language has different random functions that are different ways of getting a random generator how do i call different programming language librarys please? |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Maybe you should read this.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Feb 2006
Posts: 28
Rep Power: 0
![]() |
How do i set the "random seed" To get different random number sequences?
What sets the random number sequences like how to i change the "order" of the "number sequence"? How do u change the current time at program's startup? Why is the sequence is different at each startup? How do u change the returns a random value in range? |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Make a call to srand.
What order? Look at <ctime> functions and make an OS API call. What sequence? Change what?
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#5 |
|
Programmer
Join Date: Sep 2005
Location: GA
Posts: 99
Rep Power: 4
![]() |
#include <ctime>
int Rand(int num);
int Rand(int num)
{
unsigned int _time = time(NULL);
srand(_time);
return (int) rand() % num;
} |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Feb 2006
Posts: 28
Rep Power: 0
![]() |
How to change the sequence order?
How to change the random order? Why make a OS API call? How do i call external librarys that have random functions please? How do i call external programming languages functions that have different random functions please? |
|
|
|
|
|
#7 |
|
Newbie
Join Date: Feb 2006
Posts: 28
Rep Power: 0
![]() |
What is the theory behind random generators?
How can i make a random generator by scratch and manually make one from ground up please? The Random function is controlled by a Timing clock? |
|
|
|
|
|
#8 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
G . O . O . G . L . E
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#9 |
|
Newbie
Join Date: Feb 2006
Posts: 28
Rep Power: 0
![]() |
Yes google is good but can u help me also
|
|
|
|
|
|
#10 |
|
Newbie
Join Date: Feb 2006
Posts: 28
Rep Power: 0
![]() |
Where can u get different seeds?
or can u make up seeds from scratch? The seed generates the psudeo random number? Which clocks? What is a "pid" please? ""something non-constant is probably best so that its not something you can guess and get the exact same results every time."" Can u please give examples |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|