Darwinbots Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
New Installer for Dawinbots 2 Released.
Home
Help
Search
Members
View the memberlist
Search For Members
Login
Register
Darwinbots Forum
»
Bots and Simulations
»
DNA - General
»
Randomness
« previous
next »
Print
Pages: [
1
]
Author
Topic: Randomness (Read 3921 times)
Light
Bot Destroyer
Posts: 245
Randomness
«
on:
February 26, 2005, 11:48:24 AM »
I want to get a random number between say -20 and 20, I thought
20 rnd 40 rnd sub
but this doesn't seem to work, am I being a bit dense?
Logged
PurpleYouko
Bot God
Posts: 2556
Randomness
«
Reply #1 on:
February 26, 2005, 12:06:41 PM »
Try changing it around a bit.
You have a total range of 40 from -20 to +20 so you need to start out with...
40 rnd
Next you want to take away 20 to centre the result around zero...
40 rnd 20 sub
This won't be perfect as the exact middle is -0.5 but it is close enough
:D PY :D
Logged
There are 10 kinds of people in the world
Those who understand binary.
and those who don't
PY
Light
Bot Destroyer
Posts: 245
Randomness
«
Reply #2 on:
February 26, 2005, 12:39:06 PM »
of course thanks PY :)
Logged
Print
Pages: [
1
]
« previous
next »
Darwinbots Forum
»
Bots and Simulations
»
DNA - General
»
Randomness