Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Looking for any source code with random function

Status
Not open for further replies.

yanne

Newbie level 4
Newbie level 4
Joined
Aug 10, 2004
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
45
random function

can you pls send any source code that uses random function,, any thnks! :lol: :cry:
 

Re: random function

hi ,
this is simple dice roll function written and tested in C language. :idea: :roll: :wink:


Code:
void roll(){

srand((unsigned) time(&t));
rol=rand()%7; display();

}

evey time when u will call this function. The variable rol will get new random value range from 1 to 6. To increase the range of random numbers use greater number instead of7 in
rand()%7;

hope it'll work for u... :eek:
 

Re: random function

hi
i not sure will this be helpful or not. but they explain random in very engineering term.

h**p://www.embedded.com/showArticle.jhtml?articleID=20900500

wisely
 

Re: random function

thanks,, your help means a lot to me thnks! :p
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top