0 registered members (),
1,094
guests, and 1
spider. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Random in LITE-C ??
#291832
09/28/09 12:14
09/28/09 12:14
|
Joined: Jan 2005
Posts: 267 the Netherlands
Paulo
OP
Member
|
OP
Member
Joined: Jan 2005
Posts: 267
the Netherlands
|
Hi, Is my 3d gs buggy?? Im only trying to get a rondom number code:
function random_number()
{
var number = 0;
number = integer(random(500));
printf("%i",(int)number );
}
Keeps giving my the same number over and over, 404 :s
The more you have.. the more you can lose... Dont tell em all you know.....
|
|
|
Re: Random in LITE-C ??
[Re: Widi]
#291841
09/28/09 12:56
09/28/09 12:56
|
Joined: Jan 2005
Posts: 267 the Netherlands
Paulo
OP
Member
|
OP
Member
Joined: Jan 2005
Posts: 267
the Netherlands
|
x = integer(random(10)); // returns a number between 0 and 9
right out of the manual..
The more you have.. the more you can lose... Dont tell em all you know.....
|
|
|
Re: Random in LITE-C ??
[Re: Paulo]
#291845
09/28/09 13:33
09/28/09 13:33
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
if you dont use random_seed(0); or randomize(); function at least once in your app, it will always return same random number when you use same limit. this is also the case in C.
3333333333
|
|
|
Re: Random in LITE-C ??
[Re: SomebodyNew]
#291862
09/28/09 15:01
09/28/09 15:01
|
Joined: Nov 2008
Posts: 26 France
Hirogens
Newbie
|
Newbie
Joined: Nov 2008
Posts: 26
France
|
hi,
yes, in general..
the random generator of all compiler are bad. never use this for a real game.
but it's my opinion...
the same problem for sin,cos,tan function. never use. use record of sin,cos,tan etc.
regards
Last edited by Hirogens; 09/28/09 15:04.
|
|
|
Re: Random in LITE-C ??
[Re: Hirogens]
#291873
09/28/09 17:32
09/28/09 17:32
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
the random generator of all compiler are bad. never use this for a real game.
what defines "good random generator"? i mean why do you think it's bad. It generates your random number after all. all of them does that.
3333333333
|
|
|
|