Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Circle Racing , (RND) Question

Author
Message
RisTar_sn
19
Years of Service
User Offline
Joined: 15th Jan 2005
Location:
Posted: 20th Feb 2006 11:47
Ive created a code of 3 circles locate in the left side of the screen , i want all three to move in a random speed value and in the end 1 of them will get to the end of the screen and win the race. my only problem is that i use the RND command , and the result are not so good , first of all every time i run the program i get the same result so i dont think its random , and seconed there are two circles running the same speed . some1 can help me figure it out ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 20th Feb 2006 14:46
Always start any code that involves random numbers with:

RANDOMIZE TIMER()

I won't bore you with the details, do a forum search and you'll find it

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 20th Feb 2006 18:33
Odd..the center ball never moves for me o.0

FunkyStickmen: Battle of the Races (1%)
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 20th Feb 2006 20:50
@ RisTar_sn

Numbers generated from the "rnd" command are integer... they will never be float. Also you need to add +1 to the random number because circles with zero speed won't move at all.




RisTar_sn
19
Years of Service
User Offline
Joined: 15th Jan 2005
Location:
Posted: 20th Feb 2006 21:20
Thanks guys its working .. but is there a way to be sure that there wont be to balls that runing the same speed ?

Login to post a reply

Server time is: 2024-09-24 17:39:24
Your offset time is: 2024-09-24 17:39:24