Aug 10, 2004 #1 Y yanne 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:
Aug 10, 2004 #2 D dani Full Member level 4 Joined Mar 8, 2004 Messages 231 Helped 6 Reputation 12 Reaction score 4 Trophy points 1,298 Location UK Activity points 2,217 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...
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...
Aug 10, 2004 #3 W wisely77 Member level 4 Joined Jun 18, 2002 Messages 75 Helped 4 Reputation 8 Reaction score 3 Trophy points 1,288 Activity points 677 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 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
Aug 14, 2004 #4 Y yanne Newbie level 4 Joined Aug 10, 2004 Messages 6 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 45 Re: random function thanks,, your help means a lot to me thnks!